I'm trying to make a program that will delete a given row in a MySQL table, except I'm having trouble with the "id" column. It is defined as "id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY". Even if the last row is the one that is deleted, adding a new row afterwards will skip a number. For instance, here is the original table:
id | name | number
1 | john | 123
2 | mike | 234
3 | emma | 345
Then this query is called:
DETELE FROM $TableName WHERE id='3'
When a new row is added, the table looks like this:
id | name | number
1 | john | 123
2 | mike | 234
4 | jack | 456
How can I fix this, so the table looks like this:
id | name | number
1 | john | 123
2 | mike | 234
3 | jack | 456