php在表格中从1到无限的列中排序单元格

i have table with php code like this

name    points

jeme      19
yoka      15
zinga     13

please do it by php code and also no i will give you my code to edit

<?php 

// make connecion
mysql_connect('localhost', 'db user', '');

// Select Database
mysql_select_db ('db name');


$sql="SELECT sum(points) as sumpoints , name FROM wp_wp_pro_quiz_toplist group by name order by sumpoints DESC";

$records=mysql_query($sql);




?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>الاحصائيات النهائية لمسابقة اكتوبر</title>
</head>

<body>

<table class="wpProQuiz_toplistTable">
                
            <tr>
            
                <th style="">Name</th>
                <th style="width: 60px;">Points</th>
            <tr>
<?php 

 while($wp_wp_pro_quiz_toplist=mysql_fetch_assoc($records)) {
     
     echo "<tr>"; 
     
 
     
     echo "<td>".$wp_wp_pro_quiz_toplist[name]."</td>";
     
     echo "<td>".$wp_wp_pro_quiz_toplist[sumpoints]."</td>";
     
     echo "</tr>"; 
     
     
     }// End While

?>               
           
                        
    </table>

</body>
</html>

every thing is ok with this table and i ordered names by name who win more points as you see but i still want another column and i will call it [position] and shourcut for it pos. , cause i want to rank user by this way ( numbers 1-2-3-4 ) like this

pos.     name      points

 1       jeme         19
 2       yoka         15
 3       zinga        13
</div>

You can add a column for the position in html. And then, when you parse your sorted data, you can increment a variable like this :

$i=1;
while($wp_wp_pro_quiz_toplist=mysql_fetch_assoc($records)) {
         echo "<tr>";
         echo "<td>".$i++."</td>";
         echo "<td>".$wp_wp_pro_quiz_toplist[name]."</td>";
         echo "<td>".$wp_wp_pro_quiz_toplist[sumpoints]."</td>";
         echo "</tr>"; 
}// End While