Title: How to track down this SQL error?
Last modified: August 21, 2016

---

# How to track down this SQL error?

 *  [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/how-to-track-down-this-sql-error/)
 * I notice in my error log file the following:
 * [04-May-2013 10:17:02] 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 SQL_CALC_FOUND_ROWS wp_rb_posts.
   ID FROM wp_rb_posts INNER JOIN wp_rb_term_relationships ON (wp_rb_posts.ID = 
   wp_rb_term_relationships.object_id) WHERE 1=1 AND ( wp_rb_term_relationships.
   term_taxonomy_id = 6861 made by require(‘wp-blog-header.php’), wp, WP->main, 
   WP->query_posts, WP_Query->query, WP_Query->get_posts
 * I have no idea what is causing this error. How can I best debug the problem? (
   google searching didn’t help me much)
 * Thanks.

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/how-to-track-down-this-sql-error/#post-3720955)
 * Looks like you are missing a closing paren after 6861.
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/how-to-track-down-this-sql-error/#post-3720962)
 * Update: I found out that this is caused by turning on “Optimize IN clauses in
   the feedwordpress plugin.
    I hope the plugin author will fix this soon.
 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/how-to-track-down-this-sql-error/#post-3720965)
 * You may post it at the plugin’s dedicated support section:
    [http://wordpress.org/support/plugin/feedwordpress](http://wordpress.org/support/plugin/feedwordpress)
 *  Thread Starter [talgalili](https://wordpress.org/support/users/talgalili/)
 * (@talgalili)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/how-to-track-down-this-sql-error/#post-3720966)
 * Thanks [@krishna](https://wordpress.org/support/users/krishna/) – I already did:
   
   [http://wordpress.org/support/topic/sql-error-in-error-logs?replies=2](http://wordpress.org/support/topic/sql-error-in-error-logs?replies=2)

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

The topic ‘How to track down this SQL error?’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [talgalili](https://wordpress.org/support/users/talgalili/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/how-to-track-down-this-sql-error/#post-3720966)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
