Getting MySQL Generated Keys

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I am a Java/JSP developer by trade but am currently developing a
MySQL/PHP solution.

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

thehuby wrote:

Quoted text here. Click to load it

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 | |

Re: Getting MySQL Generated Keys

Cheers Chris that worked a treat!

<a href=' '>Accessible Web Design by

Site Timeline