Creating Search Engine: MySQL Warning
i am creating a search engine..
and i am getting an error
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\wamp\www\major project\search.php on line 22
in the command written below
sql_select_db ("music_park");
$get= mysql_query("SELECT * from searchengine");
while ($getrow= mysql_fetch_assoc($get))
{
//explode our search
$search_explode = explode(" ", $search);
foreach ($search_explode as $search_each)
{
//construct query
$x++;
if ($x==1)
$construct .= "keywords LIKE '%$search_each%'";
else
$construct .= "OR keywords LIKE '%$search_each%'";
}
//echo out construct
$construct = "SELECT * from searchengine WHERE '$construct'";
$run = mysql_query ('$construct');
$foundnum = mysql_num_rows('$run');
if ($foundnum ==0)
echo "no result found";
else
{
echo "$foundnum result found! <p>";
}
}
please somebody help me out to remove this error..
thank you very much...!!!