sftrprod
01-10-2006, 01:02 PM
Hi,
On my web site I've got a MySQL table of news with an AUTO_INCREMENT column that contains the ID of each news article. But when I delete an article it messes up the order.
1, 2, 3, 4, 5
after deleting '4' becomes:
1, 2, 3, 5
If this happens, my 10-articles-per-page thing won't work and may give errors.
How do I get around decreasing the ID of every article above the deleted article and decreasing the AUTO_INCREMENT by 1 without using a huge looping SQL query. Thanks.
On my web site I've got a MySQL table of news with an AUTO_INCREMENT column that contains the ID of each news article. But when I delete an article it messes up the order.
1, 2, 3, 4, 5
after deleting '4' becomes:
1, 2, 3, 5
If this happens, my 10-articles-per-page thing won't work and may give errors.
How do I get around decreasing the ID of every article above the deleted article and decreasing the AUTO_INCREMENT by 1 without using a huge looping SQL query. Thanks.