asavage Posted November 16, 2007 Share Posted November 16, 2007 Hi I am beginner with PHP and mysql. I just switched web hosting companies. My previous server was using mysql 4.1, now my new one uses mysql 5.0. My code was working fine with 4.1, but now with the same code and databases I receive this error on two occasions. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.vivan/asavage/www.quinnauctions.net/login.php on line 30 if(mysql_num_rows($result) == 1) { session_start(); $_SESSION['logged_in'] = true; header('Location: protected.php'); } How is this suppose to be to work with mysql 5? Quote Link to comment Share on other sites More sharing options...
Barand Posted November 16, 2007 Share Posted November 16, 2007 Use echo mysql_error(); after your call to mysql_query() to find out why if failed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.