Forum Moderators: coopster

Message Too Old, No Replies

Multiple Pages - Same Reccord

         

webfoo

6:03 pm on Jun 27, 2008 (gmt 0)

10+ Year Member



Me: idiot
Project: complicated

Problem:

PAGE A: Updates a database with inital info (ip, date, etc). Writes a form, which submits to Page B.

PAGE B: Supposed to write more info to the same reccord as Page A.

How can I capture which record id Page A writes to, so that Page B can write to the same reccord.

cameraman

11:28 pm on Jun 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$result = mysql_query('SELECT LAST_INSERT_ID() AS lastinsertid FROM table_name');
if ($row = mysql_fetch_array($result)) {
$id = $row['lastinsertid'];
}

Then, personally, I'd save the id in the SESSION instead of sending it out to the world with the form.