How to write mysql I add each data ID + 1mysql how & nbsp; write I add each data & nbsp; ID + 1 & nbsp; for example, I have 2 fields & nbsp; one is ID & nbsp; the other is content & nbsp; if I add a mysql entry, how do I add one data ID + 1?
How to write mysql? each time I add a data ID + 1
For example, if I have two fields, one is ID and the other is content, if I add a content, it will automatically generate
ID content
1 fwefawf
ID 1 is automatically generated
If you add another content, ID2 is automatically generated, and so on.
ID content
1 fwefawf
2 fwafawddd
------ Solution --------------------
Reference:
Alter table pic_1 add id int default 0 not null auto_increment, add primary key (id );
I have run this SQL statement, but it still does not add fields. I want to add the id auto-increment field to the pic_1 table.
Run this sentence, delete the id field, and try again.
Alter table pic_1 add id int (9) primary key auto_increment