Originally posted by pinehead18
.....
$sql = "SELECT * FROM users where uname='$uname' and pass='$pass'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row["uname"] == $uname && $row["pass"] ==
$pass) {
.....
.....
Anthony [/B]
Just another note, redundant code can often be a source of typos or syntax errors, you could eliminate one change of error by changing your if check to be:
if (mysql_num_rows($results) == 1)
I had a script that didnt work, written similiar to yours, and redoing the if check for some reason made it work,
another thing to check, are $user and $pass BOTH set before the query? if they are coming from a $_POST var... possible its not setting them as you think....