I am getting very aggravated try to validate an authorised user, however I am not getting any errors but its not giving the correct response when either you have entered the correct user details or not. The varible of $nrows stays at "0"
Orginally the first part of the sql statement request worked (varible $nrows = "1") when I tried a verified a user before adding the user to the table now with this php statement it doesn't! What am I doing wrong?
// Check Username
include ("serverdtls.php");// Server Details
mysql_connect($host,$user,$spassword) or die(mysql_error());
mysql_select_db($database);
$sql = "SELECT userName FROM Auth_members WHERE userName = '$userName'";
$result = mysql_query($sql) or die(mysql_error());
$nrows = mysql_num_rows($result);
//echo "
$nrows</p>";
if (($nrows == "1" )|| ($nrows > "1")) {//Username Correct
mysql_connect($host,$user,$spassword) or die(mysql_error());
mysql_select_db($database);
$sql = "SELECT userName FROM Auth_members WHERE userName = '$userName' AND password = '$pwd'";
$result2 = mysql_query($sql) or die(mysql_error());
$nrows2 = mysql_num_rows($result2);
if (($nrows2 == "1" ) || ($nrows2 > "1")) {//Password Correct
//include (Memberlog.inc)
include( "http://www.mysite.com/xxx/....." );
exit();
}
else {
$msgno = "1";
include ("MemLogin.php" );
exit();
}
}
else if($nrows == "0") {
header ("Location:
http://www.mysite/xxx2." );
exit;
}
?>
