MySQL Forums
Forum List  »  Newbie

Re: retrieve autoincrement value in PHP
Posted by: Umesh Shastry
Date: May 30, 2005 08:28AM

Hi!!

use mysql_insert_id() to get last insert id..

Try this..

$table_add = "INSERT INTO table (ID,field) VALUES (NULL, '$field')";
$bool = mysql_query($table_add);

echo "Thanks $text, record ID: ".mysql_insert_id();

Take a look at here

http://fr.php.net/mysql_insert_id

Regards,
Umesh Shastry
http://www.blogger.com/profile/02551756983528645221

Options: ReplyQuote


Subject
Written By
Posted
Re: retrieve autoincrement value in PHP
May 30, 2005 08:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.