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
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
2 matches
Mail list logo