How can I register a session based on a field from my MySQL table?
Posted on 2009-04-17
I have a simple login form that does a fine job of registering a session allowing the user to login based on the email and password in the USERS table. My checklogin.php does this:
// username and password sent from signup form
$sql="SELECT * FROM $tbl_name WHERE Email='$myusername' and Password='$mypassword'";
$row = mysql_fetch_assoc($result);
// Mysql_num_row is counting table row
// If result matched $myusername and $mypassword, table row must be 1 row
// Register $myusername, $mypassword and redirect to file "login_success.php"
$_SESSION["ClientID"] = $row['ClientID'];
and redirects to my welcome page. However, it doesn't seem to be creating the session that I want (ClientID). Am I doing something wrong?