On 18/04/06, Chris Grigor <[EMAIL PROTECTED]> wrote:
> Was wondering if there is an easier way to get returned variables into
> the $_SESSION rather than going through each one??

First of all, why are you using mysql_fetch_object and then passing in
MYSQL_ASSOC? You should be using $line = mysql_fetch_array($result)
instead. If you get the row data as an associative array, you can then
simply do:

foreach ( $line as $key => $value )
{
    $_SESSION[$key] = $value;
}

That way, whatever columns you select from the database will
automatically be loaded into session variables, so if you change the
SQL, you'll also change the sessions. I think this is what you're
asking for, apologies if I'm misinterpreted the question.

Paul

--
Data Circle
http://datacircle.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to