oskom Posted December 3, 2007 Share Posted December 3, 2007 Hello all, I've got a recurring error in the log that reads "supplied argument is not a valid MySQL result resource in /usr/local/ftp/path/to/file/page.php on line 56". This error occurs on various pages and always in reference to iterations of... while($row = mysql_fetch_array($result)) or... $row = mysql_fetch_array($result) I always get results from the mysql queries in question so why would this be an error? Link to comment https://forums.phpfreaks.com/topic/80034-php-error-log-question/ Share on other sites More sharing options...
revraz Posted December 3, 2007 Share Posted December 3, 2007 What does your query look like Link to comment https://forums.phpfreaks.com/topic/80034-php-error-log-question/#findComment-405516 Share on other sites More sharing options...
oskom Posted December 3, 2007 Author Share Posted December 3, 2007 There are various queries, but here's an example that keeps coming up... $result = mysql_query("SELECT * FROM calendars WHERE calendarID = ".$_REQUEST['calendarID']); while($row = mysql_fetch_array($result)) { //LOOP THROUGH DATA } Link to comment https://forums.phpfreaks.com/topic/80034-php-error-log-question/#findComment-405534 Share on other sites More sharing options...
phpSensei Posted December 3, 2007 Share Posted December 3, 2007 The error is saying that the table you selected, or even coloumn within the table is invalid. Check all your database information and tables.. $result = mysql_query("SELECT * FROM calendars WHERE calendarID = ".$_REQUEST['calendarID']); to $result = mysql_query("SELECT * FROM calendars WHERE calendarID = ".$_REQUEST['calendarID'].""); Link to comment https://forums.phpfreaks.com/topic/80034-php-error-log-question/#findComment-405537 Share on other sites More sharing options...
PFMaBiSmAd Posted December 3, 2007 Share Posted December 3, 2007 The error means that your mysql_query() function calls are failing and returned a FALSE value instead of a result resource. For each query, you will need to find out why it failed. If this is occurring randomly, then it would either mean that the mysql server is experiencing problems or that you are not validating and checking your data that is being put into the query. It also means that your code is not checking if the mysql_query() failed and blindly continues executing instead of outputting a meaningful error message and stopping. Link to comment https://forums.phpfreaks.com/topic/80034-php-error-log-question/#findComment-405543 Share on other sites More sharing options...
oskom Posted December 3, 2007 Author Share Posted December 3, 2007 Responding to revraz...I've always done that only because those ID's are just integers and not text strings. In looking at the other pages with errors, that does seem to be the common thread. PFMaBiSmAd, would revraz's observation about the end quotes in the query result in any of what you mentioned? Link to comment https://forums.phpfreaks.com/topic/80034-php-error-log-question/#findComment-405553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.