Location: PHPKode > scripts > Ratings Script > kbratings/kbratings/rating_function.php
<?php
function scrlistrating($listid)
{
	$qrylistrating="SELECT * FROM scrratinglist where listid='$listid'";
	$rsllistrating=mysql_query($qrylistrating);
	//$nlistrating = mysql_num_rows($rsllistrating);
	$arrlistrating =  mysql_fetch_row($rsllistrating);
	
echo "<h3>Current User Rating for $arrlistrating[1]</h3>";

$ratingsmaxnum="10";
$ratingyesnum=FLOOR($arrlistrating[2]/1);

for ($i=0; $i<$ratingyesnum; $i++)
{
echo "<img src='images/star1.gif'>";
}
for ($i=$ratingyesnum; $i<$ratingsmaxnum; $i++)
{
echo "<img src='images/star0.gif'>";
}
echo "<br>";
echo "Rating: $arrlistrating[2]<br>";
echo "Votes: $arrlistrating[3]";
}
?>
Return current item: Ratings Script