mysql search table query
Posted: Fri Jan 29, 2010 2:25 pm
the following code will search different collums in my table ok, but if i search for 'joe bloggs' it will return no result as joe is in collum1 and bloggs in collum2. any ideas how i would code it to find it?
Code: Select all
<?php
$result = mysql_query("SELECT * FROM profileu WHERE email = '$qry' or firstname LIKE '%$qry%' or lastname LIKE '%$qry%'");
while($row = mysql_fetch_object($result)) {
print "$row->firstname";
print "<br>";
}
?>