I have the following fields: firstname and lastname
keyword is $keyword
if someone searches for: John Doe
I want it to be able to return results.
now it returns results if its john, or if its doe.
here is the code:
$q1 = strtolower($_GET["q"]);
$q=str_replace(" ","%",$q1);
$sql = "select DISTINCT users.*, user_id FROM users WHERE $email_filter
firstname LIKE %$q% OR lastname LIKE %$q% ORDER BY lastname";
$rsd = mysql_query($sql);
while($rs = mysql_fetch_array($rsd)) { echo $results }
非常感谢你们。