Title: Error Syntax SQL [AND tt.term_id IN ()]
Last modified: August 20, 2016

---

# Error Syntax SQL [AND tt.term_id IN ()]

 *  Resolved [nodokita](https://wordpress.org/support/users/nodokita/)
 * (@nodokita)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/)
 * Hi ! I have this.. and more of this in the error log:
 * [29-Dec-2012 20:36:16 UTC] 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 de la base de datos de WordPress para la consulta SELECT
   COUNT(tt.term_id) FROM wp_term_taxonomy tt, wp_term_relationships tr WHERE tt.
   taxonomy = ‘category’ AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id
   = 7204 AND tt.term_id IN () realizada por require(‘wp-blog-header.php’), require_once(‘
   wp-includes/template-loader.php’), include(‘/themes/MyTheme/single.php’), wp_related_posts,
   wp_get_related_posts, wp_rp_get_related_posts, wp_rp_should_exclude
    …..
 * I desactivate the plugin, and the problem stop.
    I have been using this plugin
   in 3 pages, and all have the same error.. differents hostings, themes, and plugins
   instaled.. Can you help me? thanks!
 * [http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/](http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/)

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

 *  Plugin Author [jureham](https://wordpress.org/support/users/jureham/)
 * (@jureham)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315463)
 * Hi,
 * I’m not sure it will fix the issue but I pushed something that potentially could
   to the development version.
 * [http://downloads.wordpress.org/plugin/wordpress-23-related-posts-plugin.zip](http://downloads.wordpress.org/plugin/wordpress-23-related-posts-plugin.zip)
 * Please try it out.
 * Thanks,
 * Jure
 *  Thread Starter [nodokita](https://wordpress.org/support/users/nodokita/)
 * (@nodokita)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315464)
 * I will try! Thanks!
 *  Thread Starter [nodokita](https://wordpress.org/support/users/nodokita/)
 * (@nodokita)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315497)
 * No more errors in the Logs, thank you very much !!
 *  [xdaseinx](https://wordpress.org/support/users/xdaseinx/)
 * (@xdaseinx)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315498)
 * Great!
 *  [forsandree](https://wordpress.org/support/users/forsandree/)
 * (@forsandree)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315515)
 * I’m getting the same error at the top of my 404 error pages. Disappears when 
   the plugin is disabled. Any ideas what’s causing this?
 *     ```
       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 tt.term_id IN (1,9,12,14)' at line 1]
       SELECT COUNT(tt.term_id) FROM wp_term_taxonomy tt, wp_term_relationships tr WHERE tt.taxonomy = 'category' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = AND tt.term_id IN (1,9,12,14)
       ```
   
 *  [forsandree](https://wordpress.org/support/users/forsandree/)
 * (@forsandree)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315516)
 * Oh, forgot to mention, I am using the version in the zip above.
 *  Plugin Author [jureham](https://wordpress.org/support/users/jureham/)
 * (@jureham)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315518)
 * Hi,
 * please try the new version from
    [http://downloads.wordpress.org/plugin/wordpress-23-related-posts-plugin.zip](http://downloads.wordpress.org/plugin/wordpress-23-related-posts-plugin.zip)
 * Thanks.
 * Best, Jure
 *  [forsandree](https://wordpress.org/support/users/forsandree/)
 * (@forsandree)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315521)
 * Works like a charm! Thanks!
 *  Thread Starter [nodokita](https://wordpress.org/support/users/nodokita/)
 * (@nodokita)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315529)
 * With the new version (2.3) this fix it’s included? It’s safe update the plugin?
   Thanks!

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

The topic ‘Error Syntax SQL [AND tt.term_id IN ()]’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-23-related-posts-plugin_7b9a7c.
   svg)
 * [WordPress Related Posts](https://wordpress.org/plugins/wordpress-23-related-posts-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-23-related-posts-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-23-related-posts-plugin/reviews/)

## Tags

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

 * 9 replies
 * 4 participants
 * Last reply from: [nodokita](https://wordpress.org/support/users/nodokita/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/error-syntax-sql-and-ttterm_id-in/#post-3315529)
 * Status: resolved