Hi,
I am currently trying to build a rating system and it seems my script is adding one to the result.
$getRat = "SELECT AVG(votes) AS rating, COUNT(votes) as count FROM svotes WHERE songid = '$songid'";
$grating = mysql_query($getRat, $conn) or die(mysql_error());
$rowr = mysql_fetch_array($grating);
$rating = number_format($rowr['rating'],2);
$vcount = $rowr['count'];
If the mysql has 4 entries in the votes columns that are "5", the echoed result of $rating will be 6.00? What am I doing wrong here?
Thanks.