session HELL !!!!!!

From: Date: Mon, 16 Oct 2000 03:23:01 +0000
Subject: session HELL !!!!!!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20294@lists.php.net to get a copy of this message
hi folks, here's the scenario, user fills in a form to add a record to a database. record is created and uses mySQL autoincrement to create the record ID. I then use the PHP function mysql_insert_id() to return the ID of the created record. I then use session_register to write the value of this created record ID into the session registry for this user. At this point, the user may choose to work further on the created record, (accessing the data through the ID in the session), or create a second new record. In the later case (creating a new record) I do a "SESSION_UNREGISTER" of the ID and use "SESSION_REGISTER" to write in the new value once this has been determined by the script. however, the session only remembers the old value.???????????????? here is a chunk of hte code, at this point it assumes a valid entry and good result insertion into hte mysql database session_unregister("contactID"); $contactID = mysql_insert_id(); session_register("contactID"); but this doesnt work... the value of $contactID is correct in the script, but in the session data the contactID is the same as the last time round... what am I doing wrong ?????????????????????????? richard

« previous php.general (#20294) next »