Hi, i'm trying to perform a simple serach on a database. I have it working so far, but as soon as multiple words are entered into the search string, no results are displayed.
Heres an example of the code i'm using at the moment:
<?
mysql_pconnect("locahost","username","password");
mysql_select_db("results");
$result = mysql_query ("SELECT * FROM cars WHERE search LIKE '%$search%'");
while($r=mysql_fetch_array($result))
{
$column=$r["color"];
echo $column;
echo "<br>";
}
?>
So if someone types search for Ford, all Ford cars will be displayed, yet if someone searches for Ford Granada, nothing is displayed, yet Ford Granada is a name in column search.
How can I search through the column looking for multiple words rather than just single?
Thanks for taking time to read this post and thanks in advance for any replies.
Ant