dworsky
Member
Posted 4 years ago #
I just upgraded to 2.5.1 this afternoon, and am getting repeated entries in the error_log that say:
[27-Apr-2008 17:27:01] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 for query SELECT cat_id, cat_name FROM made by include
Any idea what this means or how to fix it? (I am guessing that 2.5 had a similar problem because the error log was 65 megs.)
Thanks,
Edgar
The error message looks odd, is that the whole thing? It's supposed to tell you the file and line number with the bad query.
Probably it's an old plugin -- the cat_id, cat_name, etc. fields were removed in WP 2.3.
My mistake, it doesn't tell you the file & line number.
Search for the string SELECT cat_id, cat_name in your WP directory, or try disabling plugins.
http://codex.wordpress.org/Plugins/Plugin_Compatibility/2.3
http://codex.wordpress.org/Plugins/Plugin_Compatibility/2.5
dworsky
Member
Posted 4 years ago #
Sam,
I deactivated all plugins... and the same error message appeared in the error_log.
When you say "Search for the string SELECT cat_id, cat_name in your WP directory" ... can you be more specific? Look in every file of every directory/subdirectory for that string? And then what?
Thanks,
Edgar
If you have a copy of your WordPress directory on your computer, and you have a text editor that can search multiple files, you could search them all at once for SELECT cat_id, cat_name and so find which file is making the bad query.
You can (temporarily) add define('WP_DEBUG', true) to your wp-config file -- that will print the database warning on the page, hopefully near the source of the problem. See http://codex.wordpress.org/Editing_wp-config.php#Debug
Try switching to the default theme, too.
dworsky
Member
Posted 4 years ago #
Sam...
I did it! I found the offending string in a COMMENTED OUT section of my index page for the Simple Green theme. Somehow, despite being commented out, WordPress was trying to read and use it!
I deleted the commented out area and I think that solves it.
Thanks for your help.
Edgar