On Thu, 26 Jul 2001 09:47, Dana Holt wrote:
> Hello everyone,
> I am very new to PHP (only 2 days now!), and I am having a problem with
> MySQL.
> This is probably simple.
> Ok, I insert a new row into a database that has an AUTO_INCREMENT key
> defined.
> How to get the value of the AUTO_INCREMENT field of the row I just
> inserted? My database doesn't have any other columns that are
> guaranteed to be 100% unique. I need this value to create a file with
> data related to the row.
> Thanks in advance for any help!

mysql_insert_id is the function you want. Have a read through the mysql 
section of the docs to see what other goodies are available. I suspect 
mysql_error will be one you may find useful :-)

David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc

   A camel is a horse planned by committee.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to