PDA

View Full Version : PHP search help


chadconger
07-30-2006, 02:35 AM
Okay guys here is my problem. I have a table in my database called info. In this table there is a field named keywords. The keywords in this field are seperated by a comma and a space (example: 'dog, black, fuffy, cute'). I have a form on a page called seachform.php that posts the variable $keywords to a page named search.php. This is where I'm stuck. How do I search the database for key words? I'm not sure hoe to write the SQL query or how to handle the post if the user enters more than one word such as 'black dog'. Any help would be great! THANKS!

FuZion
07-30-2006, 03:54 AM
I suppose you could use MySQL's FULLTEXT search. Google it, there's alot of tutorials.

mylegoh
08-02-2006, 07:42 PM
I would suggest using regular expression in your mysql search command. There quite a few tutorials online. Try google-ing.