Increase Row Count by 1
Adding an identification number for each entry of your database can help your visitors sort through the database content. If you added an ID field in your SQL dump which assigns an ID number to each row already, then that can be a good way of achieving this goal. However, let's say you display your ID number for each row on your site and delete an entry. You will see that the number was skipped. I will show you a way to count rows displayed on your site page without missing numbers.
The Code
Place the following code at the beginning of your page. Make sure that the document's file extension is .php and that your host provides PHP Support.
<?php $Cnt = 1; ?>
Basically, this sets up your count. We will begin at 1, however, you can change 1 to 0 if you wish to use whole numbers. Also, you can place integers/negative numbers if it suits your purpose.
Next, to display the number with each database entry, please the following code within your loop or the script you use to call out entries. Of course you can add style to it and even place it within text. What this code will show on your page is simply the number in text format.
<?php echo($Cnt++); ?>
Customize
If you want to have two of these counters on the same page, You can modify the code name:
<?php $Cnt = 1; ?>
will become…
<?php $Name = 1; ?>
All you have to do is replace Cnt with your new label. Keep in mind, you can use numbers, but no other special characters like hyphen or underscore AND capitalization matters. As well, you will need to modify the second part of the code:
<?php echo($Cnt++); ?>
will become…
<?php echo($Name++); ?>
There you have it! I hope that can solve your problem of missing ID numbers.