Posted by Chris Hope on 10/12/82 11:16
thehuby wrote:
> 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?
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.
http://www.php.net/mysql_insert_id
--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
[Back to original message]
|