andylord Posted April 8, 2010 Share Posted April 8, 2010 i am getting the following error on page: http://cop-help.com/Testing/Redupdate.php Warning: mysql_numrows() expects parameter 1 to be resource, boolean given in /customers/cop-help.com/cop-help.com/httpd.www/Testing/Redupdate.php on line 10 $query= "SELECT * FROM Runesred WHERE id='$id'"; $result=mysql_query($query); $num=mysql_numrows($result); Line 10 is the the code above i am not sure why this is happening can anyone explain to me why this is happening :S Quote Link to comment https://forums.phpfreaks.com/topic/198027-id/ Share on other sites More sharing options...
premiso Posted April 8, 2010 Share Posted April 8, 2010 Change this and see what error comes up: $result=mysql_query($query) or trigger_error("Query Failed: " . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/198027-id/#findComment-1039083 Share on other sites More sharing options...
andylord Posted April 8, 2010 Author Share Posted April 8, 2010 Change this and see what error comes up: $result=mysql_query($query) or trigger_error("Query Failed: " . mysql_error()); Notice: Query Failed: No database selected in /customers/cop-help.com/cop-help.com/httpd.www/Testing/Redupdate.php on line 9 But i have connected and have tested the database connection to it Quote Link to comment https://forums.phpfreaks.com/topic/198027-id/#findComment-1039085 Share on other sites More sharing options...
premiso Posted April 8, 2010 Share Posted April 8, 2010 Somewhere you are either calling mysql_close or you are not calling mysql_select_db It is hard to say which without more code, but I am sure you can look through and make sure that the select_db is being ran and that there are no premature calls to mysql_close Quote Link to comment https://forums.phpfreaks.com/topic/198027-id/#findComment-1039087 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.