Forum Moderators: coopster
Im on to my latest project,,,,learning how to make a search engine type thing. I want to be able to search through multiple fields, eg 'title' & 'description' for keywords that a user types in,, much like google or something. I dont really have a clue how to do this so if anyone wants to help id be glad of some comments.
just a question: are you using a mysql database for this and you're looking for a sql query string to search the fields?
here is a related thread on another forum [forums.devshed.com] about this where i found this peace of code:
SELECT product_id FROM products
WHERE (product_name LIKE "%some%" OR product_description LIKE "%some%")
AND (product_name LIKE"%product%" OR product_description LIKE "%product%"); -hakre
SN
it is contained in only a few code pages, if you want it stick mail me
Be advised that you will either need to change you table structure to fit for any search engine or rebuilt it to fit your table structure
ill probably need to split up the user entered data as well wont i? say if some one writes
web designer
in the keywords field ill have to split it into "'web' or 'designer'" ,, or "'web' and 'designer'" depending on what the user asks for in a drop down box.
I havnt started building this yet this is just research at the mo,, better to get it all out first i think,, then ask questions on porblems i have with it later..