0

In my project i wanna use the last_insert_id() to be stored in a session variable and after that i wanna use that session variable i.e., the value of last_insert_id() in another page. How can i carry the last_insert_id() to some other page using session or storing it in a session variable ? Urgent pls... :) Thanks

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by CFROG
0
session_start();
// INSERT query here
$_SESSION['last_insert'] = mysql_insert_id($link);

That should give you the gist of it.

0

depends what you want to do with this - if just to propogate - fine. But if you want to use it as an absolute last id in the DB table - perhaps not so good if you have multiple users with insert/delete access to said table.

0

I'm not even going to comment at this point ...... Ardav has it nuts on. I've learned as much from Ardav as you are about to plus some .... I'll leave it at that. Listen to what he has to say.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.