I am using the following code to search for words in my database:
$result = mysql_query("SELECT * from company_data WHERE (comp_name like '%$query%') OR (comp_info like '%$query%') OR (prod_list like '%$query%') OR (services_list like '%$query%')");
Say I am searching this article:
We are a manufacturer & exporter, we specialize in toy designing, manufacturing & exporting.
for the words: toy exporting specialize
I get no results.
But if I type in the search the following: toy
I get the above article and other articles containing that one word.
How can I modify the above select to search word by word thats in the string?
if I type the following in the search:
We are a manufacturer
I get the database that has the string "We are a manufacturer". Can I have the select command search for indavidual words as well as the full string? Then print them out in relevance order?
Does anyone have any working code that they have used that can be shown as an example? Thanks for the help everyone.