Forum Moderators: phranque
I have an Auto Increment set up but for some reason it doesn't count up from the last object inside.
I have 3 objects inside right now.
+----+-----------+--------------+---------------------------------+
¦ id ¦ parent_id ¦ name ¦ description ¦
+----+-----------+--------------+---------------------------------+
¦ 0 ¦ 0 ¦ Top ¦ This is the top level category. ¦
¦ 1 ¦ 0 ¦ Motherboards ¦ ¦
¦ 6 ¦ 0 ¦ sub ¦ sub cat ¦
+----+-----------+--------------+---------------------------------+
I want the first one "Top" to have an id of 0 and then "Motherboards" to have an id of 1. From there I want it to count up from 1. For some reason it remembers objects that were deleted and counts up from there. Because of this it skips 2 and goes to 6. If I delete "Sub" and add a new one, the id will be set to "7".
I have looked all over the MySQL site but still have been unable to find a fix, unless "Top" would be set to 1 and count from there.
Anyone know a fix to this?
Thanks in advance. :)
Wes
ALTER TABLE table_name AUTO_INCREMENT = 27