Hi!
I want to pull out all the information there is about a specific user from a mysql database, and then automatically getting the field_name as a variabel that is set to the value of that field, and then registerd in a session.
Some code I've been playing with, but not working.
<?php
$user_name = "brainMan";
$query_user = mysql_query("SELECT * FROM user WHERE user_name='$user_name'");
while ($userarray = mysql_fetch_assoc($query_user)) {
while (list($key, $val) = each($userarray)) {
$key = $val;
session_register("$key");
}
}
?>
The problem here is that session_register needs to be called with the variabel name without the dollarsign ($),
i.e.
If $key is user_name the variabel that should be saved in the session should be $user_name and so forth.
Solutions anyone ?