hi everyone
I need help regarding my php code.
I used array to insert data in the database.
I want the value will be in ranking system such as:
1 0.575
2 0.456
3 0.327
the thing is the value whic is in the database such as 0.575 will be double when display. how to fix this problem. I got stuck for several days.
here I put my code to rank and display the value:-
$q= "select * from supplier_report order by report_value desc";
$result=mysql_query($q);
$rank = 0;
$points = 0;
$rankIncrement = 1;
while ($user=mysql_fetch_array($result))
{
if ($user['report_value'] == $points)
{
$rankIncrement++;
}
else
{
$rank += $rankIncrement;
$rankIncrement = 1;
}
echo "$rank";
echo "<br>{$user['report_value']}</br>";
}