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

前端 未结 4 1885
無奈伤痛
無奈伤痛 2020-12-01 07:04

I need to insert a long row with 32 fields into a MySQL table.

I\'d like to do something like this:

$sql=\"insert into tblname values (... 32 fields          


        
4条回答
  •  难免孤独
    2020-12-01 08:07

    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.

提交回复
热议问题