denno020 Posted March 16, 2011 Share Posted March 16, 2011 I was wondering how I could consolidate the row id's in my tables? In some tables, I have row id's that go 1, 2, 3, etc, but then jump from say 7 to 10, and then to 14 etc.. This is due to deleting rows that were in between before.. Is there a way I can consolidate these rows so that they're all back in order from 1 to however many there are.. Thanks Denno Link to comment https://forums.phpfreaks.com/topic/230785-fixing-row-id-numbering-issue/ Share on other sites More sharing options...
bh Posted March 16, 2011 Share Posted March 16, 2011 Hi, I guess your id column is an auto_increment col. So what you said its true, if you delete a row than the auto_inc value of the table doesnt change. But! its not a good idea to change those "gapped" ids - cuz maybe theres a reference to it. If your foreign keys are perfect (means CASCADES...) and theres everywhere, then you wont get error, but only this point, i think. Link to comment https://forums.phpfreaks.com/topic/230785-fixing-row-id-numbering-issue/#findComment-1188084 Share on other sites More sharing options...
fenway Posted March 17, 2011 Share Posted March 17, 2011 Don't ever change them -- ever. Link to comment https://forums.phpfreaks.com/topic/230785-fixing-row-id-numbering-issue/#findComment-1188755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.