I'm getting this error with my simple login system:
My code then looked like this:
if ($_POST['Submit'] && $_POST['username'] && $_POST['password']){
$username = $_POST['username'];
$password = $_POST['password'];
$sql="SELECT * FROM users WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
$_SESSION['username'] = $username;
header("location:main.php");
}else {
echo "Wrong Username or Password";
}
}
I then edited my $result line to this:
$result=mysql_query($sql)or die (mysql_error());
And got this result:
The column "password" does exist, so I have no clue what's causing this. Can you help me?