title: Display number sequence based on the number of data in database
body: <p><img src="https://i.stack.imgur.com/IBQNF.png" alt="enter image description here"></p>
  
  <p>How can I display the number based on the number of data from database.</p>
  
  <p>For example, the above picture, shows data extract from the database. In my database there are two data. Therefore I would like to display number 1 and 2 at the No column. </p>
  
  <p>And if there is four data in the database, I would like to display number 1, 2, 3 and 4 at the No column. </p>
  
  <p>Coding to display the above table</p>
  
  <pre><code>&lt;?php
  $sql= mysql_query ("SELECT * FROM employee INNER JOIN cash ON employee.emp_id = cash.emp_id WHERE cash_status='Pending'");
  echo "&lt;table id='dataTable' width='850' border='1' align='center'&gt;";
  
  echo "&lt;tr&gt;
          &lt;th height='50'&gt;No&lt;/th&gt;
          &lt;th height='50'&gt;Employee Number&lt;/th&gt;
          &lt;th height='50'&gt;Name&lt;/th&gt;
          &lt;th height='50'&gt;Department&lt;/th&gt;
          &lt;th height='50'&gt;Date Apply&lt;/th&gt;
          &lt;th height='50'&gt;Date Cash To Be Use&lt;/th&gt;
          &lt;th height='50'&gt;Amount&lt;/th&gt;
          &lt;th height='50'&gt;Status&lt;/th&gt;
          &lt;th height='50'&gt;Cash Id&lt;/th&gt;
          &lt;th height='50'&gt;View&lt;/th&gt;
      &lt;/tr&gt;";
  
  
      while ($row = mysql_fetch_array($sql))
      {
          echo "&lt;tr&gt;";
          echo "&lt;td align='center' height='30'&gt;&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;" .$row['emp_id']. "&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;" .$row['emp_name']. "&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;" .$row['emp_department']. "&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;" .$row['cash_dapply']. "&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;" .$row['cash_duse']. "&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;RM" .$row['cash_amount']. "&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;" .$row['cash_status']. "&lt;/td&gt;";
          echo "&lt;td align='center' height='30'&gt;" .$row['cash_id']. "&lt;/td&gt;";
          echo"&lt;td height='30'&gt;&lt;a href= cadvance_approval.php?id=".$row['emp_id']."&amp;cash_id=".$row['cash_id']."&gt;&lt;img src='../img/view_user.png' width='20' height='20'&gt;&lt;/a&gt;&lt;/td&gt;";
          echo "&lt;/tr&gt;";
      }
  echo "&lt;/table&gt;";    
  ?&gt;
  </code></pre>
  
  <p>Thanks.</p>