Working on the back side of my site.
Writing the login script for my CMS, and I'm running into a problem.
This is the first time that I've worked with PHP on a server that doesn't have REGISTER_GLOBALS turned on, so I'm almost certain it's something to do with the way I'm doing things. I'm sure it's a stupid mistake; one that I'll no doubt slap myself in the forehead for once someone offers a solution.
Here's the code in question:
Code:
$userName = $_POST['userName'];
$userPass = $_POST['userPass'];
DBConnect("contraba_users");
$sqlCheckUser = mysql_query("SELECT `userID` FROM `users` WHERE `userName` = '$userName' LIMIT 1") or die (mysql_error());
$sqlCheckPass = mysql_query("SELECT `userID` FROM `users` WHERE `userPass` = '$userPass' LIMIT 1") or die(mysql_error());
if(mysql_num_rows($sqlCheckUser == "0") || mysql_num_rows($sqlCheckPass == "0")){
header("Location: ./?stype=error&error=1");
}
And here's the body of the page:
Quote:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/contraba/public_html/admin.php on line 53
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/contraba/public_html/admin.php on line 53
|
Any insight would be very welcome.