PHP mySQL - Insert new record into table with auto-increment on primary key

后端 未结 5 1236
予麋鹿
予麋鹿 2020-12-01 06:02

Wondering if there is a shorthand version to insert a new record into a table that has the primary key enabled? (i.e. not having to include the key column in the query) Lets

5条回答
  •  被撕碎了的回忆
    2020-12-01 06:39

    This is phpMyAdmin method.

    $query = "INSERT INTO myTable
             (mtb_i_idautoinc, mtb_s_string1, mtb_s_string2) 
             VALUES
             (NULL, 'Jagodina', '35000')";
    

提交回复
热议问题