My table call a series of products. With php I generate a row to insert a product. Every time I create a new row it should generate consecutive numbers for each products inserted.
You do not need to generate the ID using PHP, you can set the auto_increment option for the ID field on your database, it will assign the ID automaitcally
You can find better examples and more info here