note 46620 added to ref.session
| From: | bennettpratyahoodotcom at osu1 dot php dot net | Date: | Sun, 17 Oct 2004 20:39:47 +0000 |
| Subject: | note 46620 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78704@lists.php.net to get a copy of this message | ||
It seems you can't programatically set session vars, but have to explicitly declare the name
and value. (php4.3.8 on win2k)
eg, this *doesn't* work (ie no session vars are assigned):
foreach($row as $key => $value)
{
$_SESSION["".$key.""] = $value;
}
but this will:
$_SESSION['username'] = $row['username'];
$_SESSION['address_1'] = $row['address_1'];
etc etc
shame, as populating a $_SESSION array from a db record would be much easier if it could be done
programatically....
----
Manual Page -- http://www.php.net/manual/en/ref.session.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46620
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46620&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46620&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46620&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46620&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46620&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46620&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46620&report=yes
Search -- http://master.php.net/manage/user-notes.php