Title: error in your SQL syntax
Last modified: August 30, 2016

---

# error in your SQL syntax

 *  [donnytree](https://wordpress.org/support/users/donnytree/)
 * (@donnytree)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/error-in-your-sql-syntax-4/)
 * Hello,
 * I am getting the following error in my error logs:
    [Mon Aug 10 05:48:26 2015][
   error] [client 66.249.92.54] 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 ‘%d) GROUP BY wp_ngg_pictures.pid ORDER BY id DESC’
   at line 1 for query SELECT DISTINCT wp_ngg_pictures.* , GROUP_CONCAT(CONCAT_WS(‘
   @@’, meta_key, meta_value)) AS ‘extras’ FROM wp_ngg_pictures LEFT OUTER JOIN 
   wp_postmeta ON wp_postmeta.post_id = extras_post_id WHERE (exclude = %d) GROUP
   BY wp_ngg_pictures.pid ORDER BY id DESC made by nggMediaRss::get_last_pictures_mrss,
   nggdb::find_last_images, C_Image_Mapper->run_query, ExtensibleObject->__call,
   ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, C_CustomTable_DataMapper_Driver_Mixin-
   >run_query
 * I am using the most recent version of WP 4.2.4, and the most recent NextGen version
   2.1.2.
 * Thanks!
    Donna
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

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

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/error-in-your-sql-syntax-4/#post-6417677)
 * [@donnytree](https://wordpress.org/support/users/donnytree/) – What troubleshooting
   steps have you already taken to try to sort this out?
 * Where exactly are you seeing this error message?
 * – Cais.
 * PS: Thanks for starting your own topic, too.
 *  Thread Starter [donnytree](https://wordpress.org/support/users/donnytree/)
 * (@donnytree)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/error-in-your-sql-syntax-4/#post-6417678)
 * I am seeing it in our error logs and I’m not really sure what to do to troubleshoot
   it? I updated to the most recent version of NextGen but that didn’t fix it. I
   am happy to try whatever else you think might help.
 * Thanks so much! And apologies again for posting in the wrong place!
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/error-in-your-sql-syntax-4/#post-6417681)
 * [@donnytree](https://wordpress.org/support/users/donnytree/) – This is not a 
   common issue so I would suspect some sort of conflict happening on your site 
   as a starting point. Have you tried deactivating all of your plugins, clearing
   your browser cache (and site caches if you are using a caching plugin), then 
   reactivating the NextGEN plugin?
 * If this fixes the problem then it was likely one of the deactivated plugins that
   was causing an issue. Now, retrace your steps activating each plugin and re-checking
   to see if the problem returns. If it does then that last activated plugin was
   probably the one. Keep reactivating and in most cases it is also best to keep
   checking after each plugin, sometimes there may be more than one plugin on a 
   site that will create an issue. If you do find one (or more) plugins causing 
   this problem we would greatly appreciate your feedback on them so the developers
   may address them as soon as they can.
 * Also to note, in rare cases it may be the theme itself that is causing a conflict
   so while you have just the NextGEN plugin activated you might consider temporarily
   switching to one of the default WordPress Twenty series themes and see if this
   corrects the issue as well.
 * If the problem still persists after all of this we would still want to know, 
   even more so, as we will still want to sort out the issue and may need additional
   details.
 * Thanks!
 * – Cais.
 *  Thread Starter [donnytree](https://wordpress.org/support/users/donnytree/)
 * (@donnytree)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/error-in-your-sql-syntax-4/#post-6417682)
 * Got it, I will try and let you know. Thanks again!
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/error-in-your-sql-syntax-4/#post-6417690)
 * [@donnytree](https://wordpress.org/support/users/donnytree/) – Thanks!
 * – Cais.

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

The topic ‘error in your SQL syntax’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [nextgen](https://wordpress.org/support/topic-tag/nextgen/)
 * [NGG](https://wordpress.org/support/topic-tag/ngg/)
 * [sql-error](https://wordpress.org/support/topic-tag/sql-error/)

 * 5 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/error-in-your-sql-syntax-4/#post-6417690)
 * Status: not resolved