auto_increment field always gets a ZERO

admin

Administrator
Staff member
I have created a field in a MySQL 3.23.25 table using the following statement:
ALTER TABLE MyTable ADD ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

It worked fine as far as numbering my current records, but when I INSERT a new record, it gives the ID field a big fat ZERO, every time. I can add records until I'm sick of clicking and they are all ZEROs. According to the documentation, this seems impossible, even when I explicitly send it 0 or NULL:
To paraphrase:"An auto_increment field, when sent 0 or NULL, will automatically be assigned (current_highest_number_in_the auto_increment_field + 1)."

I tried including ID in my field-values pairs just for grins, sent it 0 (which, of course, resulted in 0), NULL (which results in 0) and then removed it again (you're not supposed to include it in the field-value pairs are you??) which, surprise, still results in 0. I'm at a loss and appreciate any comments or suggestions. TIA
 
Back
Top