Re: asigning an array of variables to $_SESSION

From: Date: Fri, 02 Apr 2004 18:38:44 +0000
Subject: Re: asigning an array of variables to $_SESSION
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-182165@lists.php.net to get a copy of this message
Andy B wrote:
"$_SESSION['guesbook'] = $arr;" is it safe to say that i can do this: while($_SESSION['guestbook']=mysql_fetch_array($query)) to get the same thing as $_SESSION[guestbook]=$R??
No, that will se $_SESSION['guestbook'] to one thing after another, not an array. I would suggest: while($rec = mysql_fetch_array($query)) { $_SESSION['guestbook'][] = $rec; //do something else with $rec? } -- paperCrane <Justin Patrin>

« previous php.general (#182165) next »