|
Hi All
I have a MySQL table with the fields 'title' and 'description'.
I would like the user to be able to enter a string to an input box then search the table for any rows that contain the words entered in either the title or description. My question is, what is the best way to do it? (I guess its a pretty common requirement).
I have some further requirements:
-All terms must be searched for. I guess this means no 'full text' because of stopwords? I don't control the DB therefore cannot disable stopwords.
-I am using PHP bound queries. This means I have to statically define the number of variables, so I can't have something like 'title LIKE '%x%' AND title LIKE '%y%' AND title LIKE '%z%' as I don't know how many terms will be searched for.
The script is for a job I've applied for so the optimum, efficient solution is paramount.
Any ideas?
|