Unsetting array elements?
Hi everyone, Im having a spot of bother working out how to unset an array contained in a session. This: unset($GLOBALS[HTTP_SESSION_VARS][partners_upload][$adId]); does NOT work, neither does using $_SESSION instead of HTTP_SESSION_VARS -- when i query the sessions table, the 'partners_upload' array still contains the $adId element (which itself is an array). Can anyone suggest where i might be going wrong here? many thanks.. -- Nick Wilson http://performancing.com/user/1
unset($_SESSION[...]) should work. Rob Roy Barreca Founder and COO Electronic Insight Corporation http://www.electronicinsight.com rob@electronicinsight.com Nick Wilson wrote:
Hi everyone,
Im having a spot of bother working out how to unset an array contained in a session.
This: unset($GLOBALS[HTTP_SESSION_VARS][partners_upload][$adId]); does NOT work,
neither does using $_SESSION instead of HTTP_SESSION_VARS -- when i query the sessions table, the 'partners_upload' array still contains the $adId element (which itself is an array).
Can anyone suggest where i might be going wrong here?
many thanks..
* and then Rob Barreca declared....
unset($_SESSION[...]) should work.
yes, it was very confusing for a long while, but eventually i tracked it down to a misplaced db_set_active and a php setup that wasn't throwing out errors as it should do which made the problem kind of hard to spot. sorry for the odd question guys.. -- Nick Wilson http://performancing.com/user/1
participants (2)
-
Nick Wilson -
Rob Barreca