Sidebar is nothing but SQL errors
-
I had been using a template that did not use any of the normal WordPress sidebar features and manually set all links, so I never knew about this until today. Recently, my page ended up getting automatically blocked in China (somehow due to my template) and changing my template fixed the problem. However, every template I try, even the WordPress default, shows endless SQL errors for every sidebar field save “search.”
The strange part about this is, the rest of the site works perfectly. All the links open fine, things show what they are supposed to, and the only other error is an ob_start message at the top courtesy of my server’s PHP running on paranoia settings.
You can check the page yourself at https://www.cinnamonpirate.com/. It seems to me that somehow $wpdb does not even exist despite it being pulled into the sidebar functions with a global command. If you look at the exact SQL error, it dies because things it depends on from $wpdb are not present for the query.
I already wiped out my original files and replaced them with the WordPress 1.5.2 release on this site, just in case one of my changes was responsible.
The errors are:
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 ‘WHERE link_visible = ‘Y’ ORDER BY link_name ASC’ at line 4]
SELECT link_url, link_name, link_image, link_target, link_description, link_rating, link_rel , IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated , UNIX_TIMESTAMP(link_updated) AS link_updated_f FROM WHERE link_visible = ‘Y’ ORDER BY link_name ASCWordPress 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 ‘WHERE post_status = ‘static’ ORDER BY post_title ASC’ at line 1]
SELECT * FROM WHERE post_status = ‘static’ ORDER BY post_title ASCWordPress 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 ‘WHERE cat_ID > 0 ORDER BY cat_ID asc’ at line 3]
SELECT cat_ID, cat_name, category_nicename, category_description, category_parent FROM WHERE cat_ID > 0 ORDER BY cat_ID ascWordPress 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 ‘) AS cat_count FROM INNER JOIN ON (cat_ID = category_id) ]
SELECT cat_ID, COUNT(.post_id) AS cat_count FROM INNER JOIN ON (cat_ID = category_id) INNER JOIN ON (ID = post_id) WHERE post_status = ‘publish’ AND post_date_gmt < ‘2005-11-09 13:50:52’ GROUP BY category_idWarning: Invalid argument supplied for foreach() in /home/virtual/site19/fst/var/www/html/wp-includes/template-functions-category.php on line 311
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 ‘WHERE post_date < ‘2005-11-09 09:50:52’ AND post_status = ‘publi]
SELECT DISTINCT YEAR(post_date) ASyear
, MONTH(post_date) ASmonth
, count(ID) as posts FROM WHERE post_date < ‘2005-11-09 09:50:52’ AND post_status = ‘publish’ GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC
- The topic ‘Sidebar is nothing but SQL errors’ is closed to new replies.