Fw: [PHP-DB] determine the primary key after adding a row to a table (mysql)
| From: | Richard Emery | Date: | Wed, 24 Apr 2002 17:33:20 +0000 |
| Subject: | Fw: [PHP-DB] determine the primary key after adding a row to a table (mysql) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18776@lists.php.net to get a copy of this message | ||
$lastid = mysql_last_id();
returns auto_increment from inserted record
----- Original Message -----
From: CJ <calistusj@hotmail.com>
To: <php-db@lists.php.net>
Sent: Wednesday, April 24, 2002 4:19 PM
Subject: [PHP-DB] determine the primary key after adding a row to a table
(mysql)
is there any way to determine the primary key of a row after it's added to a
table in mysql?
i need to do this because i have another table which requires the id from
one table as a foreign key.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php