Jump to content

How can i insert into table with auto_increment column ?


colap

Recommended Posts

It's a mysql table.

The first column is int(11) auto_increment not null primary key,

I want to insert data into that table without specifying the first column name.

What would be the sql query?

The firs column is col1 with auto_increment.The value for the first column would be automatically inserted.Is it?

 

insert into tablename(col2,col3)

values("a","b");

Print the actual query, none of this "col2" and "tablename" stuff.  Obviously your fake pseudo-query would work fine.

 

Do a SHOW CREATE TABLE on the table, post that here.

 

Do an INSERT on the table, post that here as well as the error.

 

-Dan

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.