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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.