Hi. I tried looking for this problem on Google, and found a lot, but nothing that actually seems to work. I basically have a search script that works fine when using one keyword, but when one uses more than that, it returns every single row per keyword. So a search for "hello kitty" doesn't look for "hello" and "kitty", but for "hello" and then another time for "kitty".
I know there's something wrong with my code, but, what? And how can I solve this issue.
// get the search variable from URL
$var = @$_GET['q'] ;
// trim whitespace from the stored variable
$trimmed = trim($var);
// separate key-phrases into keywords
$trimmed_array = explode(" ",$trimmed);
// build SQL Query for each keyword entered
foreach ($trimmed_array as $trimm)
{
$query = "SELECT * FROM (articles LEFT JOIN authors ON articles.author_id = authors.author_id) WHERE text LIKE '%$trimm%' ORDER BY issue DESC" ;
// and then the queries and everything; with which nothing's wrong
}
Can someone help me?