I am getting this error on other pages that lead to this one, but i can't find out what I'm doing wrong... can anyone help? The error reads: Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in ...on line 9. Can anyone help me?
<?
if(!defined('TBL_ACTIVE_USERS')) {
die("Error processing page");
}
$q = "SELECT username FROM ".TBL_ACTIVE_USERS
." ORDER BY timestamp DESC,username";
$result = $database->query($q);
$num_rows = mysql_numrows($result);
if(!$result || ($num_rows < 0)){
echo "Error displaying info";
}
else if($num_rows > 0){
echo "<table align=\"left\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n";
echo "<tr><td><font size=\"2\">\n";
for($i=0; $i<$num_rows; $i++){
$uname = mysql_result($result,$i,"username");
echo "<a href=\"userinfo.php?user=$uname\">$uname</a> / ";
}
echo "</font></td></tr></table><br>\n";
}
?>