Ben Curran wrote: > If one has created a table, with a key using auto_increment, how does one > Insert data into it?
Data is automatically inserted for you ;-) > If my table consists of (inID (primary key, auto incremented), employeeID > (foreign key) time, date). > if I use > $dbh->do("INSERT INTO timein VALUES('$employeeID','$timein','$day')"); > obviously, it tells me that > DBD::mysql::db do failed: Column count doesn't match value count. When not specifying fields MySQL expects all columns including the autoincremented one. You can insert a NULL in the autoincrement value field, which causes it to auto-increment. There are good reasons to rather explicitly specify fields: $dbh->do("INSERT INTO timein(employeeID,time,date) VALUES('$employeeID','$timein','$day')"); Rune --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php