hi, i have a user management system which i want to pull information from the db solely based on the userid field in the database. When the user logs in a session is created which looks as follows:
session_register('userid');
$_SESSION['userid'] = $userid;
session_register('first_name');
$_SESSION['first_name'] = $first_name;
session_register('last_name');
$_SESSION['last_name'] = $last_name;
what would be the code to pull the content from the db?
i'm thinking it would be something like the following, but i'm not sure as this is the first time i have ever used sessions....
if($_SESSION['userid'] == $userid;{
$query = "SELECT * FROM `users";
$result = mysql_query($query);
$rows = mysql_num_rows($result);
}
thanks