Page 1 of 1

mysql_num_rows(): supplied argument is not a valid

Posted: Mon Aug 13, 2007 6:59 am
by m2babaey
Hi
can you see where the problem is:
code:

Code: Select all

function getrank($keyword, $listing){
$bid3=mysql_query("SELECT maxb FROM listing WHERE id='$listing'");
$bid4=mysql_fetch_array($bid3);
$mybid=$bid3['maxb'];
 $info5="SELECT * FROM listing WHERE keywords LIKE '%$keyword%' AND maxb > $mybid ";
 $info6=mysql_query($info5);
 $count_row =mysql_num_rows($info6);
 $rank = $count_row +1 ;
return $rank;
}
error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
thanks

Posted: Mon Aug 13, 2007 7:10 am
by feyd
Query failed most likely. mysql_error() may tell you more...

Posted: Mon Aug 13, 2007 7:28 am
by m2babaey
thanks
i was missing ' ' around $mybid