PDA

View Full Version : Script help... trying to create a search script


Ogden2k
Thu 9th Jun '05, 12:53pm
I have a MySQL DB that has 3 tables, I want to create a script that will search for fields in those tables and return results... I've never done this type of script before.

Any pointers would be helpul!

Dean C
Thu 9th Jun '05, 1:15pm
Simple solution is to build the string for your where clause. And based on which fields are being searched use:


$clause .= 'AND fieldname LIKE \'%' . cleaningfunction($search_term) . '%\'';


There's lots of other methods including indexing your content with keywords in a seperate table and also MySQL FULLTEXT search :)