我想按得分来写行号。但是我无法做到这一点。
<?php
$self=$db->query("SELECT * FROM table ORDER BY exam_name DESC");
$a1=1;
foreach ($self as $order)
{
if($order['exam_name']==$gb['exam_name']) //$gb = selected exam by user id
{
echo $a1;
break;
}
$a1++;
}
?>