At 2:43 AM +0000 10/31/01, Curtis Gordon wrote:
>I have a query where I am inserting a record into a db, and would
>like to have the primary key
>value returned, I have been reading and reading, but I can't seem to find
>any mention of this. I would think that this would be useful. Can anybody
>help?
You can't get the primary key value returned from the INSERT statement
itself. But (assuming the key is an AUTO_INCREMENT column), you can
issue this query after the INSERT to get the value:
SELECT LAST_INSERT_ID()