like command, please help

wxdqz

New Member
A site of mine has a table with a NAME and DESCRIPTION field. I have a search engine that displays the records that match the search words that a user enters. Here the part of the code that does that:

$sql= "SELECT * FROM $dbtable";
$sql.= " where antique_mantel ='$antique_mantel' and (description like $searchstring or name like $searchstring)";

if you go to the page (<!-- m --><a class="postlink" href="http://www.francisjpurcell.com/antiques.html">http://www.francisjpurcell.com/antiques.html</a><!-- m -->) you抣l see that it works but it only shows matches where the order is the same.
For example, one of the descriptions might say, "a FRENCH rosewood TABLE." If you put french and wooden in the search box (in the order), mysql finds the record. If you put wooden and french (opposite order) mysql doesn't return the record. What gives?
Thanks for you help.
 
Back
Top