RE: [PHP] Need help creating a mysql query in PHP

From: Date: Tue, 01 Oct 2002 01:44:15 +0000
Subject: RE: [PHP] Need help creating a mysql query in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-118285@lists.php.net to get a copy of this message
> I have a form containing a text field where the user types in a sentence. > I > need to search a mysql table, specifically a text field and display a list > of found results. My criteria selections are: > > 1) return a record if all the words are contained in a record > 2) return a record if all any word entered are contained in a record > 3) return a record if parts of all words (starting at the beginning) are > contained in a record (e.g.. 'ex is in 'exercise') > 3) return a record if parts of any word (starting at the beginning) are > contained in a record (e.g.. 'ex is in 'exercise') I don't quite understand your logic. It seems like a lot of trash rows would be returned, anyway... your best bet would be to look into the FULLTEXT indexing in mysql and go from there. <watch wrap> http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html #Fulltext_Search </watch wrap> ---John Holmes...

« previous php.general (#118285) next »