Here you can find an overview of all existing MySQL functions in PHP: http://www.php.net/mysql
And this is the function you are looking for: http://www.php.net/manual/en/function.mysql-insert-id.php
And please take your time to look at this posting: http://marc.theaimsgroup.com/?l=php-general&m=108986762507986&w=2
Daniel
Andrew Wood 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?
-- WWE e-commerce IT GmbH Eiffestrasse 462, D-20537 Hamburg Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php