About retrieving auto increment value

From: Date: Mon, 07 Jun 2004 17:42:51 +0000
Subject: About retrieving auto increment value
Groups: php.db 
Request: Send a blank email to php-db+get-34672@lists.php.net to get a copy of this message
Hi I have the typical problem with retrieving auto increment value in php-mysql environment. I have search info in mysql page and I have found LAST_INSERT_ID() funtion but I don't know how to use correctly. I have one script that insert a row. And another script that must retrieve last auto_increment value for primary key on a table. I want something like this: SELECT LAST_INSERT_ID() FROM foo_table; (like curval(foo_sequence) in postgres) This doesn't work. It's possible? Where I am wrong? Thanks in advance -- Marc Soler

« previous php.db (#34672) next »