hi,

it happens to me quite often that after testing a mysql table or after
deleting several rows that there are gaps in the numeration of my 'id
field' (key).

i always use the same field type for my 'id field:'
id int(255) unsigned NOT NULL auto_increment,

what is the best way to quickly correct the numeration in my id field,
so that gaps are removed and the numeration is correct again?

by 'gaps', i'm referring to when this auto_increment field has listings
like
1
2
3
7
8
9
13

i have an sql snippet like this:
ALTER TABLE mail_form2 ADD new_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD INDEX (new_id);

but this always creates the new key as the very last column in the
table.  also, i have to delete my original key first, or i get an
error-message. isn't there a fast & simple way to correct a key-index?

many thanks,

tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to