Search database
Posted: Fri Jun 27, 2003 2:22 pm
Hi,
I've made search engine on my webshop that works fine, exept that it's only outputting the rows that have a field matching the search word perfect. Here:
$word is the search string from the search form. Is there any command in mysql or PHP that will make this string find alle the rows containing a specific word?
Now there is like this, if someone search for "socks" and the there is a field containing "super socks" this does not give a hit. You have to search for the exact word. In this case "super socks".
I've made search engine on my webshop that works fine, exept that it's only outputting the rows that have a field matching the search word perfect. Here:
Code: Select all
$result = mysql_query( "SELECT * FROM products WHERE category='".$_POSTї'word']."' OR prodnr='".$_POSTї'word']."' OR product='".$_POSTї'word']."'" );Now there is like this, if someone search for "socks" and the there is a field containing "super socks" this does not give a hit. You have to search for the exact word. In this case "super socks".