How do I compare two values with eachother? Like a login page, my table look like this. (MySQL)
userid name surname password
so if Im usning the username "knuff" its have to match with knuffs password, not anyones password in the password-row.
knuff
$query = "SELECT * FROM logins WHERE (name='$name') AND (password='$password')"; $res = mysql_query($query); if (mysql_num_rows($res) > 0) { echo "login ok"; } else { echo "denied"; }
great, i will check it out. but what dose if with "greater then" do?
if username and password are correct, mysql finds 1 dataset, else none, "> 0" is just used to avoid errors, "==1" would be sufficent