Hi,
I am currently using this string for my search results:
"SELECT * from item WHERE LOWER(name) LIKE LOWER('%$keyword%') OR LOWER(desc1) LIKE LOWER('%$keyword%') OR LOWER(desc2) LIKE LOWER('%$keyword%') OR LOWER(madeof) LIKE LOWER('%$keyword%') OR LOWER(datemade) LIKE LOWER('%$keyword%') OR LOWER(price) LIKE LOWER('%$keyword%')"
but I was wanting some help in making it work better. I want to be able to search on more than one keyword ie the user enters 'mahogany high chair', I would like my query to return any results with any of these three words in it.
Also, is it possible to do it so that if someone enters 'chairs' it returns anything with just 'chair' in it???
Please help - I would appreciate it!




comparisons in MySQL are case-insensitive by default unless it's a VARCHAR BINARY/BLOB-type column or you are using BINARY in your query.



Bookmarks