pedrobcabral Posted April 20, 2007 Share Posted April 20, 2007 I have a table with the ID auto incremented. Imagine this problem: I delete ID 10 and photo 10.jpg from the pictures folder. Later on I add a new entry that will go for ID 11 but the photo will go for 10.jpg - that's because I add the photo name to the last entry from the id table. Is there anychane to know the auto_increment value? So I would sync the ID number with the foto number everytime. Thank you. Link to comment https://forums.phpfreaks.com/topic/47890-auto-increment/ Share on other sites More sharing options...
suzzane2020 Posted April 20, 2007 Share Posted April 20, 2007 if u have some other fields to be added along with the image, insert that first select the records again get the last id and update the image along with the last id Link to comment https://forums.phpfreaks.com/topic/47890-auto-increment/#findComment-234029 Share on other sites More sharing options...
pedrobcabral Posted April 20, 2007 Author Share Posted April 20, 2007 That should be enough, anyway do you know if there is any pre-defined function to get the number of the auto_increment? As we do alter table NAME auto_increment=NUMBER, is there anyway to retrive it? Link to comment https://forums.phpfreaks.com/topic/47890-auto-increment/#findComment-234030 Share on other sites More sharing options...
Lumio Posted April 20, 2007 Share Posted April 20, 2007 SHOW INDEX FROM `table`; http://dev.mysql.com/doc/refman/4.1/en/show-index.html The column Cardinality is, what you're looking for Link to comment https://forums.phpfreaks.com/topic/47890-auto-increment/#findComment-234031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.