Web Hosting Talk







View Full Version : Searching a Text field in a MySQL database for a keyword


jon31
08-07-2007, 08:02 PM
Hey folks,

I'm building a mini knowledgebase type webapp, and I'm wondering what the best way to search for a string in a text field of a MySQL database would be?

Say I type in "What is my password", and one of the entries in the database is "How do I reset my password?". How can I return this row based on the match of password?

Any tips or advice would be great! Thanks!

Jon Marus

Steve_Arm
08-08-2007, 01:16 AM
WHERE keyword LIKE '%password%';