I want to create a mini searchengine with PHP and MySQL.
The created MySQL-table contains 4 fields:
linkTitle - The title of the website (ex. Anna Kournikova Online)
linkURL - The URL of the website (ex. http://come.to/annaonline)
linkDescription - A short description (ex. Anna Kournikova fansite)
linkKeywords - Some keywords (ex. kournikova, tennis, pictures)
The user of the seachengine must enter some keywords in a
textfield. I have now problem searching a website if the user
only entered 1 word. I just use the following SQL:
$sqlquery = "SELECT * FROM $table WHERE urlTitle LIKE '%$searchstr%' OR
urlKeywords LIKE '%$searchstr%'";
But what if the user entered multiple words in the textfield?
I can use explode (sort on " " (whitespace)), but how can I construct
a good SQL-query with the words?
Thanks in advantage...
Ron, The Netherlands