I'm attempting to use multiple ANDs in this query below, and it messes up the password every time when I attempt to use my login feature. code below.
// this is my problem, right here
$result = mysql_query("SELECT username, password, FirstName FROM members
WHERE username='$myusername'
AND password='$mypassword'
AND FirstName = '$firstname'");
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_start();
$_SESSION['myusername'] = $myusername;
$_SESSION['mypassword'] = $mypassword;
$_SESSION['firstname'] = $firstname;
EDIT:
SQL Query:
Table Name: members
username | password | FirstName | LastName
johndoe deers John Doe
PHPMyAdmin tells me it returned zero rows when I run it there.