I want to populate a table from database, but don't know how to give it auto serial no from 1 to the last number starting before Staff ID. Here is the line of codes:
<?php
mysql_connect("localhost","root","") or
die ("Unable to Establish connection".mysql_error());
mysql_select_db("demoDB") or
die ("unable to select database".mysql_error());
$sql="SELECT * FROM dec2013 WHERE PFA='Pension Alliance Ltd' ORDER BY StaffName ASC";
$queryN=mysql_query($sql)
or die (mysql_error());
echo "<table border='1'>
<tr>
<td><h5>Staff ID</h5></td>
<td><h5>Staff Names</h5></td>
<td><h5>Pension Fund Administrators</h5></td>
<td><h5>Pension PIN Codes</h5></td>
<td><h5>Min. / Depts / Agency</h5></td>
<td><h5>Amount Deducted</h5></td>
</tr>";
while($rows=mysql_fetch_array($queryN))
{
echo "<tr>";
echo "<td><h5>" .$rows['Staff_ID']. "</h5></td>";
echo "<td><h5>" .$rows['StaffName']. "</h5></td>";
echo "<td><h5>" .$rows['PFA']. "</h5></td>";
echo "<td><h5>" .$rows['Pension_Pin']. "</h5></td>";
echo "<td><h5>" .$rows['MDA']. "</h5></td>";
echo "<td align=right><h5>" .$rows['Amt_Ded']. "</h5></td>";
echo "</tr>";
}
echo "</table>";
?>