section of code causing it:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/findyourdesire/stats.php on line 21
Code: Select all
# talk to the db
$db=mysql_connect($host, $login1, $pass1) or die("cannot access mysql"); # connect
$fyd=mysql_select_db('findyourdesire', $db) or die("cannot access db"); # select the db
$querystats=mysql_query("SELECT * FROM stats WHERE uid='$uin'", $db); # find the stats
$stats=mysql_fetch_array($querystats); # get the stats
$queryvotes=mysql_query("SELECT * FROM votes WHERE votee='$uin'", $db); # find the votes
$vc=mysql_num_rows($queryvotes); # how many votes
for($i=0;$i<$vc;$i++){ # for each vote
$voteinfo=mysql_fetch_array($queryvotes); # get the vote info
$vt+=$voteinfo['vote']; # find the vote total
}
if($vc==0){ $vc=1; }//prevent div by zero issue