I have a Session that stores data for a user when they login, but I can only print the data. Like so...
echo print_r($_SESSION);
WILL RETURN...
Array ([user_id] => 5 [access_level] => 4 [user_name] => user1 [division] => NEB [dept] => ALL) 1
But when I enter code like this...
$sql = "SELECT * FROM table where division = '".$_SESSION['division']."' ORDER BY status";
And do an echo of that statement, it looks like this...
SELECT * FROM table where division = '' ORDER BY status
Unless I echo the session variable, the session data disappears!
Please advise.
$SESSIONa typo? Post your code and maybe we can help. - Tim Withersprint_r()print it correctly? Are those two statements in different scripts? - Barmar