Re: anyone trickier than 'LIKE' ?

From: Date: Fri, 12 Dec 2003 13:25:52 +0000
Subject: Re: anyone trickier than 'LIKE' ?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-32026@lists.php.net to get a copy of this message
I have this data (eg.) "..........big fat buddy......." on the database . If a person enter "big buddy" in the search form , the ".......big fat buddy........." data will not be found . Any suggestion ? select * from table where data like "%keywords%";
You can break up the search terms into words and do ...data LIKE '%$keyword[0]%' OR data LIKE '%$keyword[1]%'... This will be slow though. You could also do full text searches if you are using MySQL. Have good indexes for whichever route you go. Larry

« previous php.db (#32026) next »