PHP MYSQL - Insert into without using column names but with autoincrement field PHP MYSQL - Insert into without using column names but with autoincrement field mysql mysql

PHP MYSQL - Insert into without using column names but with autoincrement field


Just use NULL as your first value, the autoincrement field will still work as expected:

INSERT INTO tblname VALUES (NULL, ... 32 Fields ... )


Insert NULL into the auto-increment field.

I recommend that unless this is a hack script, you use field names. The rationale is that your code will break if you ever add a field to the table or change their order.

Instead, be explicit with field names, and it will go much better in the future.


We should omit any column values when we try without column name in insert query,

Advise if above information is wrong.