Use MySQL Auto-increment clause. It starts with 1, and for every entry you insert in table, it is incremented by 1. What's more is that if you delete an entry, th.