coffeedemon
01-01-2004, 12:26 AM
i'm trying to make a search engine that will search a string for $q i have now:
SELECT title FROM table WHERE title REGEXP '($_GET[q])+' "
the problem with REGEXP '($_GET[q])+' is it searches the entire frase only. like if someone searched for "this that and more" it will not match a string with just "this" or "that and" it will only match a sring with the entire "this that and more".
how do i make it so it will match each word as well as the entire string?
SELECT title FROM table WHERE title REGEXP '($_GET[q])+' "
the problem with REGEXP '($_GET[q])+' is it searches the entire frase only. like if someone searched for "this that and more" it will not match a string with just "this" or "that and" it will only match a sring with the entire "this that and more".
how do i make it so it will match each word as well as the entire string?