I am creating a search engine whereby I require videos to be displayed according to the keywords input.
So for my codes, I have
$search_exploded = explode (" ", $search);
foreach($search_exploded as $search_each){
$x = 0;
$x++;
if($x>=1){
$construct ="keywords LIKE '%$search_each%'";
}
else{
$construct ="OR keywords LIKE '%$search_each%'";
}
$x = 0;
}
and
$query ="SELECT * FROM test WHERE $construct";
$runquery = mysql_query($query);
$foundnum = mysql_num_rows($runquery);
The problem lies in the $runquery as my the error i get from my browser states that the line $foundnum = mysql_num_rows($runquery);
is returning a Boolean value instead of the supposed resource type value.
Can anyone help fix this? I'm stuck on this for quite some time now. Thankful for and appreciate any help!