Pushing Vars into $_SESSION

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Afternoon

Was wondering if there is an easier way to get returned variables into the $_SESSION rather than going through each one??

eg

$link_id = mysql_connect($dbhost, $dbuser, $dbpass)
or die("Connection to $dbhost failed on verification section");

mysql_select_db($logindb, $link_id)
       or die("Selection of database failed on verification section");

$query = "SELECT * FROM blah where blah = 'blah'";

$result = mysql_query($query) or die ("Query failed: " . mysql_error());

       while ($line = mysql_fetch_object($result, MYSQL_ASSOC)) {
               $id = $line->id;
               $firstname = $line->firstname;
               $surname = $line->surname;
               $email = $line->email;
       }
mysql_close($link_id);

$_SESSION["id"] = "$id";
$_SESSION["firstname"] = $firstname;
$_SESSION["surname"] = $surname;
$_SESSION["email"] = $email;

Any help here is appreciated....

Chris

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux