Title: Error SQL syntax
Last modified: August 30, 2016

---

# Error SQL syntax

 *  [MirkoMiraPhoto](https://wordpress.org/support/users/mirkomiraphoto/)
 * (@mirkomiraphoto)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/error-sql-syntax/)
 * Hello, I have a problem with the display of the first image inserted in the gallery.
 * I get a **SQL syntax error** which I reproduce below:
    _ 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 ‘-1, 1’ at line 3 for the
   query SELECT id FROM wp\_contest\_gal1ery WHERE GalleryID = 4 AND Active = 1 
   ORDER BY rowid desc LIMIT -1, 1
 * Someone would know help me sisolvere this problem.
    It occurs only in the first
   image of each gallery.
 * Thank you
 * [https://wordpress.org/plugins/contest-gallery/](https://wordpress.org/plugins/contest-gallery/)

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

 *  [cr0co](https://wordpress.org/support/users/cr0co/)
 * (@cr0co)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-sql-syntax/#post-6843372)
 * same problem here.
 * > WordPress-Datenbank-Fehler 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 ‘-1, 1’ at line 3 f\xc3\xbcr Abfrage \n\t\t\tSELECT id\n\t\t\tFROM
   > wp_contest_gal1ery \n\t\t\tWHERE GalleryID=1 AND Active=1 ORDER BY rowid desc
   > LIMIT -1, 1\n\t\t von require(‘wp-blog-header.php’), require_once(‘wp-includes/
   > template-loader.php’), include(‘/themes/nirvana/page.php’), get_template_part,
   > locate_template, load_template, require(‘/themes/nirvana/content/content-page.
   > php’), the_content, apply_filters(‘the_content’), call_user_func_array, do_shortcode,
   > preg_replace_callback, do_shortcode_tag, call_user_func, frontend_gallery, 
   > include_once(‘/plugins/contest-gallery/frontend/frontend-gallery.php’), include_once(‘/
   > plugins/contest-gallery/frontend/show-image.php’)
 * > WordPress-Datenbank-Fehler Query was empty f\xc3\xbcr Abfrage von do_action(‘
   > toplevel_page_contest-gallery/index’), call_user_func_array, contest_gallery_action,
   > require_once(‘/plugins/contest-gallery/admin/gallery/change-gallery.php’)
 *  Plugin Author [Wasiliy Strecker / ContestGallery developer](https://wordpress.org/support/users/contest-gallery/)
 * (@contest-gallery)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-sql-syntax/#post-6843392)
 * Hello together,
 * thank you for sending me this problem.
    Could you tell me your SQL server version?
 * Will try to resolve it in next update.
 * Best regards
 * Wasiliy
 *  Thread Starter [MirkoMiraPhoto](https://wordpress.org/support/users/mirkomiraphoto/)
 * (@mirkomiraphoto)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-sql-syntax/#post-6843393)
 * Thanks for the reply, the version I’m using is the MySQL 5.5.45-37.4-log
 * Thanks for the great work
    Mirko
 *  [cr0co](https://wordpress.org/support/users/cr0co/)
 * (@cr0co)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/error-sql-syntax/#post-6843399)
 * mysql version 5.5.44

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

The topic ‘Error SQL syntax’ is closed to new replies.

 * ![](https://ps.w.org/contest-gallery/assets/icon-128x128.png?rev=3510934)
 * [Contest Gallery – Upload & Vote Photos, Media, Sell with PayPal & Stripe](https://wordpress.org/plugins/contest-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contest-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contest-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/contest-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contest-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contest-gallery/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [cr0co](https://wordpress.org/support/users/cr0co/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/error-sql-syntax/#post-6843399)
 * Status: not resolved