RE: [PHP] getting a auto-increment id back out of the database
| From: | Matt MacLeod | Date: | Fri, 09 May 2003 16:38:30 +0000 |
| Subject: | RE: [PHP] getting a auto-increment id back out of the database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147040@lists.php.net to get a copy of this message | ||
Try the 'mysql_insert_id' function.
Matt
-----Original Message-----
From: Amanda McComb [mailto:amccomb@indiana.edu]
Sent: 09 May 2003 17:26
To: php-general@lists.php.net
Subject: [PHP] getting a auto-increment id back out of the database
I have a query where I insert a bunch of stuff into a table, and it
creats a new record with a new id, auto-incremented by MySQL. Right
after
I insert this, I want to instert some other stuff into another table
using
the new id that was just created. Is there a way to get that id out
without doing a select that matches everything I just inserted
(especially
since there could be multiple records with that same data?)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php