Mateobus Posted November 7, 2006 Share Posted November 7, 2006 This is probably an easy question. I want to insert rows into my database. So say i had like an auto increment id, employee_name, and job_description columns in my table. How would I write the insert query without specifying an ID:INSERT INTO job SET values(?, $employee_name, $job_description)what should i put as the first argument? Link to comment https://forums.phpfreaks.com/topic/26487-insert-values-with-auto-increment-field/ Share on other sites More sharing options...
kirk112 Posted November 7, 2006 Share Posted November 7, 2006 when you created the table did you specify that id would auto increment? If you did you can leave that field out of the query and the number will automaticaly increase each time you run the query. Link to comment https://forums.phpfreaks.com/topic/26487-insert-values-with-auto-increment-field/#findComment-121185 Share on other sites More sharing options...
fenway Posted November 7, 2006 Share Posted November 7, 2006 Moreover, you should really specify the column list explicitly, so that no one ever misunderstands (including the DB). I wish this wasn't optional. Link to comment https://forums.phpfreaks.com/topic/26487-insert-values-with-auto-increment-field/#findComment-121206 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.