Title: Fatal error: Uncaught mysqli_sql_exception
Last modified: January 17, 2022

---

# Fatal error: Uncaught mysqli_sql_exception

 *  Resolved [louagej](https://wordpress.org/support/users/louagej/)
 * (@louagej)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/)
 * Hi,
    After installing and activating the latest version of Smart Grid-Layout 
   Design for Contact Form 7, I receive an error in the admin panel on the pages,
   posts and plugin page: `Fatal error: Uncaught mysqli_sql_exception: 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 p.post_type = 'wpcf7_contact_form'
   AND pm.meta_key = '_cf7sg_ver' at line 5 in /srv/disk4/2976396/www/lafermeoubliee.
   louage.org/wp-includes/wp-db.php:2056 Stack trace: #0 /srv/disk4/2976396/www/
   lafermeoubliee.louage.org/wp-includes/wp-db.php(2056): mysqli_query(Object(mysqli),'
   SELECT pm.meta_...') #1 /srv/disk4/2976396/www/lafermeoubliee.louage.org/wp-includes/
   wp-db.php(1945): wpdb->_do_query('SELECT pm.meta_...') #2 /srv/disk4/2976396/
   www/lafermeoubliee.louage.org/wp-includes/wp-db.php(2657): wpdb->query('SELECT
   pm.meta_...') #3 /srv/disk4/2976396/www/lafermeoubliee.louage.org/wp-content/
   plugins/cf7-grid-layout/admin/class-cf7-grid-layout-admin.php(1748): wpdb->get_col('
   SELECT pm.meta_...') #4 /srv/disk4/2976396/www/lafermeoubliee.louage.org/wp-includes/
   class-wp-hook.php(303): Cf7_Grid_Layout_Admin->init_notices('') #5 /srv/disk4/
   2976396/www/lafermeoubliee.louage.org/wp-includes/class-wp-hook.php(327): WP_Hook-
   >apply_filters(NULL, Array) #6 /srv/disk4/2976396/www/lafermeoubliee.louage.org/
   wp-includes/plugin.php(470): WP_Hook->do_action(Array) #7 /srv/disk4/2976396/
   www/lafermeoubliee.louage.org/wp-admin/admin.php(175): do_action('admin_init')#
   8 /srv/disk4/2976396/www/lafermeoubliee.louage.org/wp-admin/plugins.php(10): 
   require_once('/srv/disk4/2976...') #9 {main} thrown in /srv/disk4/2976396/www/
   lafermeoubliee.louage.org/wp-includes/wp-db.php on line 2056`
 * With the previous version (4.11) I didn’t have this problem.

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

 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15259848)
 * no changes to the SQL queries have been done since v4.11.
 * Can you please run the following SQL command on your DB (using phpMyAdmin if 
   you have),
 *     ```
       SELECT pm.meta_value FROM wp_postmeta as pm
                 INNER JOIN wp_posts as p on p.ID = pm.post_id LEFT JOIN wp_postmeta as pmf on pmf.post_id = pm.post_id
                 WHERE pmf.meta_key = '_cf7sg_managed_form'
                 AND pmf.meta_value = 1
                 WHERE p.post_type = 'wpcf7_constact_form'
                 AND pm.meta_key = '_cf7sg_version'
                 ORDER BY pm.meta_key
       ```
   
 * and see what the DB complains about
 *  Thread Starter [louagej](https://wordpress.org/support/users/louagej/)
 * (@louagej)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15260244)
 * Hi Aurovrata,
 * I receive this message:
    #1064 – 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 pmf.meta_value = 1 LIMIT 0, 25’ at line 3
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15263018)
 * ok, I just ran it on my server and there is indeed a problem. Let me check and
   get back to you.
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15263232)
 * can you please test this query on your DB,
 *     ```
       SELECT pm.meta_value FROM wp_postmeta as pm
                 INNER JOIN wp_posts as p on p.ID = pm.post_id INNER JOIN wp_postmeta as pmf on pmf.post_id = pm.post_id
                 WHERE pmf.meta_key = '_cf7sg_managed_form'
                 AND pmf.meta_value = 1
                 AND p.post_type = 'wpcf7_contact_form'
                 AND pm.meta_key = '_cf7sg_version'
       ```
   
 *  Thread Starter [louagej](https://wordpress.org/support/users/louagej/)
 * (@louagej)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15263949)
 * Hi,
 * this query results in:
    - 4.12.7
    - 4.12.7
    - 4.12.7
    - 4.12.7
 *  -  This reply was modified 4 years, 4 months ago by [louagej](https://wordpress.org/support/users/louagej/).
    -  This reply was modified 4 years, 4 months ago by [louagej](https://wordpress.org/support/users/louagej/).
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15264067)
 * good good. I am releasing v4.12.10 with the SQL fix.
 *  Thread Starter [louagej](https://wordpress.org/support/users/louagej/)
 * (@louagej)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15264400)
 * Thank you already.
    I tried to add some Dutch translation to the plugin. I hope
   this is a little help.
 *  Thread Starter [louagej](https://wordpress.org/support/users/louagej/)
 * (@louagej)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15264425)
 * Installed version v4.12.10
    The problem is solved, thank you!
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15265130)
 * great, glad that works now. Thanks for reporting this.
 * > I tried to add some Dutch translation to the plugin.
   >  I hope this is a little
   > help.
 * wonderful thank you!
 * Do leave a [review](https://wordpress.org/support/plugin/cf7-grid-layout/reviews/)
   when you have a moment to spare.

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

The topic ‘Fatal error: Uncaught mysqli_sql_exception’ is closed to new replies.

 * ![](https://ps.w.org/cf7-grid-layout/assets/icon-256x256.png?rev=1834229)
 * [Smart Grid-Layout Design for Contact Form 7](https://wordpress.org/plugins/cf7-grid-layout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-grid-layout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-grid-layout/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-grid-layout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-grid-layout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-grid-layout/reviews/)

## Tags

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

 * 9 replies
 * 2 participants
 * Last reply from: [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-mysqli_sql_exception/#post-15265130)
 * Status: resolved