id username password firstname lastname
1 sample ck3949 John DOE
Someone can login and it checks weather its the right password and then redirects them to a diferent page. On that page I want to have a message Saying "Welcome John", meaning that i need to pull the firstname out of the row of the user that is logged in.
Heres my code:
$query = mysql_query("SELECT firstname FROM users WHERE username='$user'") or die ("Can't execute: " . mysql_error()); $name = $query ?> <h1>Welcome <? print $name; ?>,</h1>
And i don't get any errors but my output is:
Welcome Resource id #4