array with sessions, only prints one letter
- by jolabero
On login:
$result = mysql_query("SELECT `id`, `username`, `email` FROM `users`
WHERE `username` = '$username'
AND `password` = '$passwd'");
$userdata = array('id','username','email');
$_SESSION['user'] = mysql_result($result, 0, $userdata);
And when i want to print the users username
echo $_SESSION['user']['username']
it only prints the first letter :/
whats wrong`?