hi,

I am trying a login page for my website. the login page works fine and i can take the username using sessions to the welcome page.

now my question:

would i be able to retrieve(show) data from mysql according to the username that i have in session?

thanks

Yea I don't see any problems...

$username = $_SESSION;

$user_result = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'");
$user_array = mysql_fetch_arrary($user_result);

echo 'Name: '.$user_array.' '.$user_array.'<br>';
echo 'Birthdate: '.$user_array.'<br>';

that should answer your question :)

The solution given above should work fine

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.