Mysql -- inserting in table with only an auto incrementing column -
lets have table 1 column, id(which primary key)
how insert new row table without specifying id?
i tried this
insert (`id`) values (null)
and doesn't work
edit: forgot mention id, primary key has auto_increment , not null attribute.
edit 2: exact error when running query above
column 'id' cannot null
as 'id' auto-increment enable (assuming id integer), can do:
insert (id) values (null)
and 'id' keep incrementing each time.
Comments
Post a Comment