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

---

# error in SQL syntax

 *  Resolved [chzumbrunnen](https://wordpress.org/support/users/chzumbrunnen/)
 * (@chzumbrunnen)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-5/)
 * Whenever I try to save a page I get an error like:
 * > Notice: Uninitialized string offset: … wp-includes/meta.php on line 1601
 * >  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 ‘) OR v.base_field_id IN ())’ at line 4]
   >  DELETE v, m FROM wp_cfs_values
   > v LEFT JOIN wp_postmeta m ON m.meta_id = v.meta_id WHERE v.post_id = ‘8030’
   > AND (v.field_id IN () OR v.base_field_id IN ())
 * and then twice:
 * > Warning: Cannot modify header information – headers already sent
 * Any ideas, if and where I can correct this or what’s the possible cause?
 * [https://wordpress.org/plugins/custom-field-suite/](https://wordpress.org/plugins/custom-field-suite/)

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

 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-5/#post-6315481)
 * It sounds like one of the fields you’re trying to save no longer exists. Were
   you editing the field group in another tab? If so, then you’ll need to refresh
   your post edit screen to reload the changed fields.
 *  Thread Starter [chzumbrunnen](https://wordpress.org/support/users/chzumbrunnen/)
 * (@chzumbrunnen)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-5/#post-6315650)
 * It happens on every save.
    What I think could be a problem, is that I imported
   posts via MigrateDB Pro from a hosts with no CFS.
 * Also the post_id in the faulty sql is not referencing to something on the page.
 * But what I found out now:
    The Custom Field Suite has default values. One value
   was a shortcode wherein the value was missing (like: [ddownload id=). So the 
   id and the closing ] where not there.
 * On the affected pages the CFS was not in use, but used to be and therefore the
   error came up.
 * If I change the template to one that has other placement rules so I can edit 
   the values to empty all default values and change the template back. It seems
   to work.
 *  Thread Starter [chzumbrunnen](https://wordpress.org/support/users/chzumbrunnen/)
 * (@chzumbrunnen)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-5/#post-6315651)
 * no, it’s not like I said, the error still continues 🙁

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/custom-field-suite.svg)
 * [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-suite/reviews/)

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