Title: WordPress DataBase Error
Last modified: August 19, 2016

---

# WordPress DataBase Error

 *  [farrelldoc](https://wordpress.org/support/users/farrelldoc/)
 * (@farrelldoc)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-51/)
 * I am getting the following error on [http://www.bayareaball.org](http://www.bayareaball.org).
   This error is also visible on the Dashboard of new users who register for my 
   website!
 *     ```
       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 'AND post_type = 'post' GROUP BY post_status' at line 1]
       SELECT post_status, COUNT( * ) AS num_posts FROM wp_posts WHERE AND post_type = 'post' GROUP BY post_status
       ```
   
 * I have the following plugins installed:
 * AddThis Social Bookmarking Widget
    Akismet CaPa Protect (THIS WAS INSTALLED AFTER
   THE PROBLEM STARTED) Fast Secure Contact Form Google Analyticator LeagueManager(
   THIS WAS INSTALLED AFTER THE PROBLEM STARTED) MCE Table Buttons (THIS WAS INSTALLED
   AFTER THE PROBLEM STARTED) MiniMeta Widget Register Plus (NOT ACTIVE)
 * I deactivated Register Plus because when I tried registering as a new user, I
   got the following error:
 * `Catchable fatal error: Object of class WP_Error could not be converted to string
   in /home/baba/public_html/wp-includes/formatting.php on line 2772`
 * When I deactivated the plugin, I was able to register without a problem, but 
   that’s when I discovered the database error listed above.
 * Also, when I log in with my admin login, I go straight to wp-admin, and if I 
   open the public site in a new tab, it shows that I am not logged in. I cannot
   view the public site as a logged in user, which is really a pain because I have
   some protected pages on there that I need to view logged in (with CaPa Protect).
 * Thanks for your help!
    Karen

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-51/#post-1642654)
 * Have you tried:
 * – deactivating **all** plugins to see if this resolves the problem? If this works,
   re-activate the plugins one by one until you find the problematic plugin(s).
 * – [resetting the plugins folder](http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F)
   by FTP or phpMyAdmin? Sometimes, an apparently inactive plugin can still cause
   problems.
 *  Thread Starter [farrelldoc](https://wordpress.org/support/users/farrelldoc/)
 * (@farrelldoc)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-51/#post-1642873)
 * Thank you for the response! I didn’t get a notification of it, so I’m glad I 
   came back to the forum! 🙂
 * I tried the first method, and that did not resolve the issue. Before I try the
   second method, I want to make sure that is the right thing to do. (I always get
   a little nervous when I mess around in phpMyAdmin.) I do have access to the wp-
   admin, and I can log in to wp-admin. (In fact, I am taken straight there when
   I log in.) The problem is that I am not recognized as a logged-in user or admin
   on the public site. I also now have no inactive plugins–I deleted all of them.
 * I will try the second option if you think it will help, but I just want to make
   sure that is the right path before I venture into the database. 🙂
 * Thanks again for your help!
    Karen
 *  Thread Starter [farrelldoc](https://wordpress.org/support/users/farrelldoc/)
 * (@farrelldoc)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-51/#post-1642874)
 * Oh–I just realized that I posted the wrong reply in the wrong thread. I have 
   another thread about another problem that hasn’t gotten a response yet.
 * The database problem seems to have disappears mysteriously???
 * But this other issue is driving me bonkers…
 * Thanks,
    Karen
 *  Thread Starter [farrelldoc](https://wordpress.org/support/users/farrelldoc/)
 * (@farrelldoc)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-51/#post-1642875)
 * I take that back–the database error is still there. 🙁
 *  Thread Starter [farrelldoc](https://wordpress.org/support/users/farrelldoc/)
 * (@farrelldoc)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-51/#post-1642876)
 * I take that back–the database error is still there. 🙁

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

The topic ‘WordPress DataBase Error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [farrelldoc](https://wordpress.org/support/users/farrelldoc/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-51/#post-1642876)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
