split keyword in search engine

From: Date: Mon, 07 Aug 2000 12:41:15 +0000
Subject: split keyword in search engine
Groups: php.general 
Request: Send a blank email to php-general+get-10456@lists.php.net to get a copy of this message
hi all i have done a basic search engine for our customers to search our cd database. the problem is that our records are stored with last name first eg Hendrix Jimi rather than Jimi Hendrix...so the way i have my search engine now, if you did a search for jimi hendrix it would come back with nothing but a search for hendrix or hendrix jimi would find everything fine. i have included my code below so i'm trying to figure out how to split the keyword and then search for all parts of it.. can any pls help.... i have looked at the php manual but this is not really covered to the extent that my feeble brain can comprehend..too much purple haze i'd say ;-) <?php $keyword = strtoupper($keyword); if($keyword) { $db=mysql_connect("localhost","username","password"); mysql_select_db("onestop",$db); if($value==code){ $sql="SELECT * FROM prodmast WHERE code LIKE '%$keyword%' order by descript"; } else if($value==descript){ $sql="SELECT * FROM prodmast WHERE descript LIKE '%$keyword%' order by descript"; } $result=mysql_query($sql); thanks jason

« previous php.general (#10456) next »