Title: WordPress database error / SQL Syntax error
Last modified: August 20, 2016

---

# WordPress database error / SQL Syntax error

 *  Resolved [indietravel](https://wordpress.org/support/users/indietravel/)
 * (@indietravel)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax-error/)
 * I’m not sure where to start looking to diagnose the following errors in WP3.5
   w/ multisite on, and BuddyPress too:
 * 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 blog_id = 1 AND meta_key = ‘last_activity” at line 1 for query SELECT *
   FROM WHERE blog_id = 1 AND meta_key = ‘last_activity’ made by require_once(‘wp-
   load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘
   init’), call_user_func_array, wpms_init, wp_publish_post, wp_update_post, wp_insert_post,
   do_action(‘save_post’), call_user_func_array, bp_blogs_record_post, bp_blogs_update_blogmeta
 * Similar errors are cropping up with every ‘publish’ activity on the site, including
   comments, etc.
 * I haven’t found any similar examples, has anyone seen this before?

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

 *  [techonda](https://wordpress.org/support/users/techonda/)
 * (@techonda)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax-error/#post-3396238)
 * You can use the database repair option
 *  Thread Starter [indietravel](https://wordpress.org/support/users/indietravel/)
 * (@indietravel)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax-error/#post-3396258)
 * Thanks – just ran that now; will keep a further eye on eye on error logs to see
   if it clears up.
 *  Thread Starter [indietravel](https://wordpress.org/support/users/indietravel/)
 * (@indietravel)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax-error/#post-3396391)
 * Yes, that seems to have cleared things up. Thanks [@techonda](https://wordpress.org/support/users/techonda/).

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

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

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [indietravel](https://wordpress.org/support/users/indietravel/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax-error/#post-3396391)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
