Parsing a phrase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all.

I have a page where the user can enter a search phrase and upon submitting, the search phrase is queried in MySQL.

However, I need to modify is so each word in the phrase is searched for... not just the exact phrase.

So, "big blue hat" will return results like:

"A big hat - blue in color"
"Hat - blue, big"

SQL would look like ....

WHERE (item_description like "%big%" and item_description like "%blue %" and item_description like "%hat%" )

So, via PHP, what is the best way to extract each word from the search phrase to it's own variable so I can place them dynamically into the SQL statement.

Thanks,


 --Rick



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux