searchengine input split

From: Date: Thu, 30 Sep 2004 10:59:59 +0000
Subject: searchengine input split
Groups: php.db 
Request: Send a blank email to php-db+get-36475@lists.php.net to get a copy of this message
I need to split the keyword on search input and generate an sql query, for ex: the input value is: europe+america,asia so I want to generate an sql like this: SELECT * FROM mytable WHERE message LIKE %europe% AND message LIKE %america% OR message LIKE %asia% The + (plus) means AND and , (comma) means OR. Also I need to control input variables to prevent error on sql query forexample an input value like: ,,,europe+america,+asia+ should not generate an error.

« previous php.db (#36475) next »