Title: WordPress database error
Last modified: August 19, 2016

---

# WordPress database error

 *  [embisiz](https://wordpress.org/support/users/embisiz/)
 * (@embisiz)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-22/)
 * I am using WP 2.0 with mysql 4.0.27-standard and php 4.4.7. Since a couple hours
   I am getting error messages related with mysql and wordpress database when I 
   try to open the root page of the blog, or any of the categories and pages. However,
   with the admin panel and with the posts, there is no problem at all. The error
   is:
 * > 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]
   >  SELECT DISTINCT * FROM wp_posts WHERE 1=1 AND post_date_gmt
   > <= ‘2007-12-26 21:43:59’ AND (post_status = “publish” OR post_author = 1 AND
   > post_status != ‘draft’ AND post_status != ‘static’) AND post_status != “attachment”
   > GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0,
 *  even above header. How can I solve this problem? As far as I know, I haven’t
   changed anything…
 * Regards,
    buyruk

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-22/#post-671246)
 * If it used to work and you really didn’t do anything to it… what was the answer
   of your host when you asked them?
 *  Thread Starter [embisiz](https://wordpress.org/support/users/embisiz/)
 * (@embisiz)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-22/#post-671253)
 * They were updating my b/w and disk space limits, but told me that has nothing
   to do with wordpress or mysql. And I am also not sure that two things are related.
   Do you have any idea, why did the problem occur? The link to my blog is here,
   you can also have a look: [my blog](http://buyruk.net)
 *  [Andrew Ozz](https://wordpress.org/support/users/azaozz/)
 * (@azaozz)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-22/#post-671281)
 * Looking at the db query, it’s missing the number of posts that are to be displayed.
   Here:
    `ORDER BY post_date DESC LIMIT 0,` There should be another number after
   that, like “LIMIT 0, 5” or similar.
 * Try to enter the number of posts for the home page again (WP 2.0 had this option,
   right). Also try asking your host to fix and optimize the tables, but make a 
   backup first.
 *  Thread Starter [embisiz](https://wordpress.org/support/users/embisiz/)
 * (@embisiz)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-22/#post-671322)
 * I was also sceptical about that part, but I was just not sure whether there is
   a limit of number of characters to be shown within an error.
 * I checked the reading properties from the admin panel and set the “post per page”
   variable one more time. Now it works just fine. Thanks for the support!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WordPress database error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [embisiz](https://wordpress.org/support/users/embisiz/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-22/#post-671322)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
