Jump to content

Archived

This topic is now archived and is closed to further replies.

Canman2005

row ID number

Recommended Posts

Dear all

I have a php insert query to insert some form data. Once the form has been submitted and the data added to the sql database, is there anyway to bring the auto increase ID number which is generated in the sql database?

Any help would be great.

Thanks

Ed

Share this post


Link to post
Share on other sites
[a href=\"http://ca.php.net/manual/en/function.mysql-insert-id.php\" target=\"_blank\"]http://ca.php.net/manual/en/function.mysql-insert-id.php[/a] will retrieve the last autoincrement ID

Share this post


Link to post
Share on other sites
Hi

That worked great, thanks.

Can the value be passed to another page via a session? How would that be done? Tried few things without any luck.

Thanks in advance

Ed

Share this post


Link to post
Share on other sites
Worked it out, if anyone is interested I passed

$_SESSION['nextid'] = mysql_insert_id();

with my php page action and then called the session name ($_SESSION['nextid']) on the next page.

Thanks anyone who helped

Ed

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.