paulbradley
Programmer
I am making a login function where a user enters a username and password. This is looked up and then a result is displayed if they have the password correct. I have the following code:
query = "SELECT password FROM users WHERE username = $username";
$result = mysql_query($query);
if ($result == $password) {
echo "your signed in";
}
else
{
echo "oops! wrong password";
}
But it always outputs that the password was wrong when I know it was right - any ideas? Thanks in advance.
query = "SELECT password FROM users WHERE username = $username";
$result = mysql_query($query);
if ($result == $password) {
echo "your signed in";
}
else
{
echo "oops! wrong password";
}
But it always outputs that the password was wrong when I know it was right - any ideas? Thanks in advance.