Re: Using and Echoing Session Variables

From: Date: Sun, 18 Jul 2004 10:39:01 +0000
Subject: Re: Using and Echoing Session Variables
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-190898@lists.php.net to get a copy of this message
Harlequin wrote:
OK, so here's my conundrum... After verifying the user and pulling all fields from the record I declare two variables (just testing here): $_SESSION['UserID'] = UserID;
now contains the string / constant UserID
$_SESSION['FurtherComments'] = FurtherComments;
now contains the string / constant FurtherComments
on the next page I start a session, everything OK. I echo the UserID variable - fine. But the FurtherComments variable simply echoes "FurtherComments" even though there's a database field called "FurtherComments".
You'd need to do the actual call to your database and select the FurtherComments field, then assign the result of that query to $_SESSION['FurtherComments'].

« previous php.general (#190898) next »