Here's the link to the on-line manual page that will help you.

http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html

-----Original Message-----
From: Dan Anderson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 09, 2003 5:06 PM
To: [EMAIL PROTECTED]
Subject: Getting the value of a row you just inserted


Is it possible to SELECT the id (indexed PRIMARY KEY AUTO_INCREMENT) of a
row that was just inserted?  I'm using PHP, I don't know if that makes a
difference?

Something like:

INSERT INTO foo (bar) VALUES ("bar");
SELECT last_insert(id) FROM foo;

Also, are there any problems with using this in an environment where you're
forking processes?

Thanks in advance,

-Dan


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to