Page 1 of 1

advance query to database

Posted: Mon May 12, 2008 11:23 pm
by cade
I have a form where one text and one button displayed to perform searching in my database. I want to perform searching not just based on the phrase provided by user but also like to perform search for every single word provided by user.

How do i implement this if my user enter query such as this: "mp3, flv, mp4". Usually, in my database, query will be made to a field that match phrase like this "mp3, flv, mp4". Now i want to enhance it by enable searching to a field that match word "mp3" or "flv" or "mp4". When I perform this using "OR" operator, the result have redundance and repeated data. Can someone show me the exact way. If you can show how google return data, would be appreciated :D

Re: advance query to database

Posted: Tue May 13, 2008 12:13 am
by Christopher
You could do something like "WHERE RIGHT(filename, 3) IN ('mp3', 'mp4', 'flv')".