[PHP] Setting session variables from a MySQL field value.

2003-01-15 Thread Stephen of Blank Canvas
Hi Everyone, I'm trying to use MySQL to store some general settings for a site I am working on, which I was then going to access as session variables on pages as needed without having to call the dB each time. However I am having problems setting the name of the session variable in a way that I

Re: [PHP] Setting session variables from a MySQL field value.

2003-01-15 Thread Mark Heintz PHP Mailing Lists
The problem may be your variable variable syntax... See if the following works: while ($row = mysql_fetch_array($result)) { session_register('config_'.$row['config_id']); ${'config_'.$row['config_id']} = $row['config_value']; } Although I personally prefer using the session superglobal