Home › Forums › Back End › Reset ID(int) to last + 1? › Re: Reset ID(int) to last + 1?
February 2, 2012 at 2:04 pm
#96022
Member
You would only need to run it when deleting an image so
Put it in your php code as a query to be run after an image is deleted so somewhere in your delete_picture.php if you have one after the ‘DELETE from imgtable WHERE id = ‘ query is run.
Note that it will only work when the image deleted is the latest added image, i.e. if you have 20 images in the system and someone deletes 4 this won’t cause the auto increment to drop to 4, but if you delete 20 then it will reset to 20