Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Getting MySQL Generated Keys
May 20, 2005, 4:35 am
rate this thread
I am a Java/JSP developer by trade but am currently developing a
In JSP when I run an INSERT statement on the db I am able to
automatically get back a list of any generated keys (without having to
do some sort of subsequent query to get the information).
Is there a PHP equivilent of this?
Re: Getting MySQL Generated Keys
Unfortunately, as with all built in PHP database functions, there's no
database abstraction layer built into PHP which will do it for any
database, but for mysql you can use the mysql_insert_id() function.
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com