You ought to use the *Boolean Full-Text Searches.*
You would then do a:

SELECT title, Comment FROM table_name WHERE MATCH (Comment) AGAINST ('+foo
+bar' IN BOOLEAN MODE);

This way the rows that contain both words have higher relevance... those
that have only one... will have lower relevance.

Or you could use:
 SELECT title, Comment FROM table_name WHERE MATCH (Comment) AGAINST ('"foo
bar"' IN BOOLEAN MODE);

Note the double quotes inside single quotes... ' "foo bar" '... needless to
say what it does... everybody had googled that way at least one time !!!

--
Gabriel PREDA
Senior Web Developer

Reply via email to