If you were to put the detail here into a console, it would probably fail:
as the result would show "...WHEREkeywords .." and "WHEREOR ..."$query = "SELECT * FROM mytablename WHERE";
foreach ($terms as $each){
$i++;
if ($i == 1)
$query .= "keywords LIKE '%each%' ";
else
$query .= "OR keyword LIKE '%each%' ";
You need to put a space after the WHERE inside the double quotes: $query = "SELECT * FROM mytablename WHERE ";
Acorn
Bookmarks