Re: [PHP-DB] spliting keywords by GET method and SQL query

2004-09-30 Thread Brian
$whereStatement=str_replace("+", " AND message LIKE ", $strToParse); $whereStatement=str_replace(",", " OR message LIKE ", $whereStatement); SELECT * FROM mytable WHERE message LIKE $whereStatement As for your invalid input example, good luck, I don't see any easy way of doing that. On Wed, 29

[PHP-DB] spliting keywords by GET method and SQL query

2004-09-30 Thread Murat BIYIKLI
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