MySQL Forums
Forum List  »  Newbie

Re: SELECT with multiple WHERE statments (using an index)
Posted by: Sean Nolan
Date: April 06, 2005 01:02PM

Here's the info on using full-text searches
http://dev.mysql.com/doc/mysql/en/fulltext-search.html
You must be using a MyISAM table to use full-text searches and you must add a full-text index in the CREATE TABLE for the table, or add it later with CREATE INDEX.

If you don't use full-text searching then you'll need to do it the way you are now, but if possible I'd recommend that you only allow for wildcards at the end of LIKE operations, so this is OK
firstname LIKE '$firstname%'
but this could be very slow
firstname LIKE '%$firstname%'

To search on lots of columns just put your filter tests together with AND if all conditions must be met, or OR if any of the conditions must be met.

Sean Nolan

Options: ReplyQuote


Subject
Written By
Posted
Re: SELECT with multiple WHERE statments (using an index)
April 06, 2005 01:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.