Title: WordPress database error: Error in SQL syntax
Last modified: August 19, 2016

---

# WordPress database error: Error in SQL syntax

 *  [jhayrocas](https://wordpress.org/support/users/jhayrocas/)
 * (@jhayrocas)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-error-in-sql-syntax-1/)
 * The error log in my blog is growing because of the following error message:
 * > [19-Sep-2010 13:16:06] 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 ‘WHERE post_status = ‘publish’ AND post_type =‘
   > post’ AND ID != 2682 ORDER BY RAN’ at line 1 for query SELECT ID, post_title,
   > post_date, comment_count FROM WHERE post_status = ‘publish’ AND post_type =‘
   > post’ AND ID != 2682 ORDER BY RAND() LIMIT 5 made by require, require_once,
   > do_feed, do_action, call_user_func_array, do_feed_rss2, load_template, require_once,
   > the_content_feed, get_the_content_feed, apply_filters, call_user_func_array,
   > wp_related_posts_for_feed, wp_get_related_posts, wp_get_random_posts, W3_Db-
   > >query
 * What could be causing this error message? I suspect it’s a plugin, but I just
   can’t pinpoint which one because I hardly know MySQL.
 * Any help would be hot.

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

 *  [mrmist](https://wordpress.org/support/users/mrmist/)
 * (@mrmist)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-error-in-sql-syntax-1/#post-1681181)
 * Turn off the plugins one by one, that’ll soon pinpoint it.
 *  Thread Starter [jhayrocas](https://wordpress.org/support/users/jhayrocas/)
 * (@jhayrocas)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-error-in-sql-syntax-1/#post-1681342)
 * I created a clone of my blog on a sandbox. With all the active plugins active
   in the clone blog as well.
 * No error log containing the same message is being created in the clone blog.

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

The topic ‘WordPress database error: Error in SQL syntax’ is closed to new replies.

## Tags

 * [mysql-error](https://wordpress.org/support/topic-tag/mysql-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jhayrocas](https://wordpress.org/support/users/jhayrocas/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-error-in-sql-syntax-1/#post-1681342)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
