MySQL errors
By Paul
3.6/5 based on 5 votes. The median rating is 4.
By Paul
These errors will always reference classes/database.php... the error messages are useless except for the fact that they indicate the problem being with the database.
To fix a MySQL error/warning, please follow this procedure:
1) If you've just upgraded from a previous version, please re-check readme.html to confirm that you've followed all steps of the upgrade procedure.
2a) If you're running version 5.0.0 or higher, you'll see a bunch of debug output on the page with the warning. Relay all of this data to support via email or forum post.
2b) If you're running the 4.1.x series still, you'll need to turn on debug mode. If the error isn't after a form submission or the like, you add &debug=1 to the URL of the page to get the debug output (or ?debug=1 if there are no other parameters being passed in the url). If you can't do that because it's a redirect page, then if you can reach your admin panel* go to your settings->system and set "debug level" to "show all queries to admin only". (If this is a warning that only shows up to non-admins, you will have to set it to "show all queries as executed" instead.) Then return to the place where the error occoured. You'll see a long query list at the top of your screen. If it's on a redirect page, you'll need to hit your browser's "stop" button to prevent it from redirecting away from the error page. Copy all the output and send it to support via email or forum post. Please state the URL where the error scoured, and any applicable changes you may have made recently (for example, if you just upgraded). Finally, go back to your admin panel and change "debug level" to "none", and wait for a response on the forum.
* If you can't reach your admin panel in step 2, do the same as above but go to phpmyadmin and use the query 'update wsngallery_settings set content="1" where name="debug"' in order to activate debug mode. At the end, use the query 'update wsngallery_settings set content="0" where name="debug"' to deactivate it. If your tables prefix is something other than wsngallery_, be sure to use that in the query. Also be sure to mention in your thread that you can't get to your admin panel.
Note: If all else fails you can suppress MySQL warnings by setting your debug level to "suppress errors." This is not advisable in most circumstances, however, as the warning usually indicates a problem which needs to be fixed.
To fix a MySQL error/warning, please follow this procedure:
1) If you've just upgraded from a previous version, please re-check readme.html to confirm that you've followed all steps of the upgrade procedure.
2a) If you're running version 5.0.0 or higher, you'll see a bunch of debug output on the page with the warning. Relay all of this data to support via email or forum post.
2b) If you're running the 4.1.x series still, you'll need to turn on debug mode. If the error isn't after a form submission or the like, you add &debug=1 to the URL of the page to get the debug output (or ?debug=1 if there are no other parameters being passed in the url). If you can't do that because it's a redirect page, then if you can reach your admin panel* go to your settings->system and set "debug level" to "show all queries to admin only". (If this is a warning that only shows up to non-admins, you will have to set it to "show all queries as executed" instead.) Then return to the place where the error occoured. You'll see a long query list at the top of your screen. If it's on a redirect page, you'll need to hit your browser's "stop" button to prevent it from redirecting away from the error page. Copy all the output and send it to support via email or forum post. Please state the URL where the error scoured, and any applicable changes you may have made recently (for example, if you just upgraded). Finally, go back to your admin panel and change "debug level" to "none", and wait for a response on the forum.
* If you can't reach your admin panel in step 2, do the same as above but go to phpmyadmin and use the query 'update wsngallery_settings set content="1" where name="debug"' in order to activate debug mode. At the end, use the query 'update wsngallery_settings set content="0" where name="debug"' to deactivate it. If your tables prefix is something other than wsngallery_, be sure to use that in the query. Also be sure to mention in your thread that you can't get to your admin panel.
Note: If all else fails you can suppress MySQL warnings by setting your debug level to "suppress errors." This is not advisable in most circumstances, however, as the warning usually indicates a problem which needs to be fixed.
Rating:
3.6/5 based on 5 votes. The median rating is 4.
Submitted: 10/06/03 (Edited 11/18/08)
Description: Dealing with SQL errors such as "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/username/public_html/images/classes/database.php on line 22"
Views:
2391 views. Averaging 1 per day.
In the most recent 30 day period, there've been 1 views.

Print
E-Mail