View Single Post
Old March 12th, 2008, 3:46 PM   #1 (permalink)
cass_is_awesome
I killed the bus driver.
On a golden path...
 
cass_is_awesome's Avatar
 
Joined in Mar 2008
Lives in Michigan
Hosted on SH138
341 posts
Gave thanks: 6
Thanked 8 times
PHP Question. Help me out here, folks.

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.
__________________
cass_is_awesome is offline   Reply With Quote