How about this: mysql> CREATE TABLE tablename (value1 int(10) AUTO_INCREMENT, value2 timestamp(14), PRIMARY KEY (value1)); Query OK, 0 rows affected (0.00 sec)
mysql> INSERT SQL_RETURN_INSERT_ID INTO tablename (value1, value2) VALUES (0, NOW()); +-------------+ | INSERT_ID() | +-------------+ | 1 | +-------------+ 1 row in set (0.01 sec) mysql> INSERT SQL_RETURN_INSERT_ID INTO tablename (value1, value2) VALUES (0, NOW()), (0, NOW()); +-------------+ | INSERT_ID() | +-------------+ | 2 | | 3 | +-------------+ 2 rows in set (0.01 sec) I'd just *love* it if inserting and retrieving the auto_increment value was atomic. Thoughts? --------------------------------------------------------------------- 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