hi
mysql_insert_id http://www.php.net/manual/en/function.mysql-insert-id.php should do it! Peter ----------------------------------------------- Excellence in internet and open source software ----------------------------------------------- Sunmaia Birmingham UK www.sunmaia.net tel. 0121-242-1473 International +44-121-242-1473 ----------------------------------------------- -----Original Message----- From: Steve Lefevre [mailto:[EMAIL PROTECTED]] Sent: 14 December 2002 21:28 To: [EMAIL PROTECTED] Subject: INSERT confirmation? PHP I'm designing a user database for PHP 4 and MySQL 3.32 or whatever. Users enter a class and it's workshops for their students. The 'Class' table has fields 'Name' and 'ID'. ID is the primary key and its an auto-incremented integer The 'Workshop' table has a field ID, Number, ClassID, Date, etc. The 'ClassID' should be the value of the ID field of its parent class. After I use an insert to create the Class data, how do I get the appropriate ClassID for the 'Workshop' table inserts? I could assume to use the very latest one, but that *might* break, as this is a multi-user database. Is there a way I can issue an insert statement, and get a return of the ID value it got? --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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