Hi All,
the following is a script to search using LIKE. i know data exists, but its simply not playing.
any help on syntax corrections would be appreciated.
regards
paul
<?php
if (isset($_POST['search'])){
echo $column = $_POST['column'];
echo "<br>";
echo $param1 = $_POST['param1'];
$srch = "%".$param1."%";
echo $SQL = "SELECT * FROM tbl_leads WHERE '$column' LIKE '$srch'";
$result = mysql_query($SQL) or die(mysql_error());
echo "<table>";
echo "<tr><td>Title</td><td>First Name</td><td>Surname</td><td>Email</td></tr>";
while ($row = mysql_fetch_assoc($result)){
echo "<tr><td>" . $row['title'] . "</td><td>" . $row['fname'] . "</td><td>" . $row['lname'] . "</td><td>" . $row['email'] . "</td></tr><br>";
}
}
?>