WordPress database error You have an error in your SQL syntax

While trying to correct the error that has been logged in the error_log file regarding suhosin.so which I blogged at my post, PHP Warning: Module ‘suhosin’ already loaded in Unknown on line 0, I also discovered another error that this blog has encountered. This time it is related to the database and the error message says:

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 count(*) FROM  made by require, require_once, include, pagination

By looking at the error message above, my instinct told me that this error might be caused by a particular WordPress Plugin I installed for my blog.

I checked the codes of every activated plugin, looking for the code, SELECT count(*) FROM. And I found this at the codes of the plugin called Pagination.

I again, checked the errors recorded on the error_log file and I found this one which I think related to the above error:

WordPress database error Unknown column ‘post_id’ in ‘field list’ for query SELECT count(DISTINCT post_id) FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)  WHERE 1=1  AND wp_term_taxonomy.taxonomy = ‘category’ AND wp_term_taxonomy.term_id IN (’44′) AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’)  ORDER BY wp_posts.post_date DESC made by require, require_once, include, pagination

In order to verify if this error is caused by the WordPress plugin called Pagination, I searched this code, SELECT count(DISTINCT post_id) FROM,  from its codes. And I was right.

So, I don’t have a choice but to deactivate the plugin to save my blog from these errors.

Incoming Visitors

  • Powered by Article Dashboard you have an error in your sql syntax; check the manual that corresponds to your mysql server version

About the Author

Leave a Reply 0 comments

Leave a Reply: