Thanks. When it says 'the last insert' is that just the last insert my
PHP script did, or the last insert on the DB as a whole?
On 16 Jul 2004, at 11:40, [EMAIL PROTECTED] wrote:
If the primary key in a MySQL DB is an autoincrementing integer, is
there anyway of automatically getting it back when I do an insert in
PHP. In other words taking the status returned by mysql_query and
extracting the PK of the record we just entered?
int mysql_insert_id ([resource link-id]) returns the key from the most
recent INSERT statement or 0 if there's no auto-increment field.
At last, a question I can answer :-)
HTH
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php