Title: Malformed SQL statements
Last modified: November 28, 2025

---

# Malformed SQL statements

 *  Resolved [yogurt4](https://wordpress.org/support/users/yogurt4/)
 * (@yogurt4)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/malformed-sql-statements/)
 * When updating the plugin to 3.3.7, something like the following statement is 
   called:
   `INSERT INTO wp_cky_cookie_categories (name, slug, description, prior_consent,
   visibility, priority, sell_personal_data, meta, date_created, date_modified) 
   VALUES ('{"en":"Necessary"}', 'necessary', '{"en":"Necessary cookies are required
   to enable the basic features of this site, such as providing secure log-in or
   adjusting your consent preferences. These cookies do not store any ... …lly identifiable
   data.<\/p>"}', 1, 1, 0, 1, '[]', 2025, '2025-11-27 18:39:47')`As you see, the
   value for “`date_created`” is 2025 instead of the proper date string.
 * My guess is that this happens because \lite\admin\modules\cookies\includes\class-
   category-controller.php has two formatting arrays with mismatched formats. One
   is at Line 185, the other is at Line 226. Starting from ‘meta’ and %s, the first
   one has %d, %s, %s, %s for the remaining two date value parameters. The second
   one has %d, %s, %s for the remaining `date_modified`. The solution is to remove
   the extra %d+%s from their end.

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

 *  Plugin Support [Nick](https://wordpress.org/support/users/nickcysupport/)
 * (@nickcysupport)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/malformed-sql-statements/#post-18735657)
 * Hi [@yogurt4](https://wordpress.org/support/users/yogurt4/),
 * Thank you for reporting this and for sharing the detailed insights. We’ve tested
   this on our side, but haven’t been able to replicate the issue where `date_created`
   is inserted as just a year value. Your notes about the formatting arrays are 
   helpful, and we’ve passed them to our development team for further review.
 * To help us look into this further, could you share your PHP version, MySQL/MariaDB
   version, and whether this was a fresh installation or an update from a previous
   version? This will help us identify if the issue is specific to your environment.
 * Thanks again for bringing this to our attention. We’ll keep you updated.
 *  Thread Starter [yogurt4](https://wordpress.org/support/users/yogurt4/)
 * (@yogurt4)
 * [6 months, 1 week ago](https://wordpress.org/support/topic/malformed-sql-statements/#post-18735756)
 * Hi,
 * It’s WP 6.8.3 + PHP 8.4 (using the official WP Docker image) and cookie-law-info.
   3.3.7.
   The plugin was updated from 3.3.5 to 3.3.6 (when it came out) then to 
   version 3.3.7 now.The DB driver is PG4WP (with PostgreSQL 17.6) but the statement
   is logged **before** it’s translated to PG flavour.
 *  Plugin Support [Nick](https://wordpress.org/support/users/nickcysupport/)
 * (@nickcysupport)
 * [6 months ago](https://wordpress.org/support/topic/malformed-sql-statements/#post-18737781)
 * Hi [@yogurt4](https://wordpress.org/support/users/yogurt4/),
 * Thank you for sharing this and for pointing out the details in the formatting
   arrays. We really appreciate the time you took to investigate this.
 * We were able to replicate the issue on our side, and it appears the mismatch 
   in the formatting placeholders is indeed causing the incorrect `date_created`
   value during the update process. Our development team has confirmed the cause,
   and we are preparing a fix.
 * This will be addressed in the** **next plugin release.
 * Thank you again for bringing this to our attention. If you notice anything else
   or have further questions, feel free to let us know. We’re happy to help.

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

The topic ‘Malformed SQL statements’ is closed to new replies.

 * ![](https://ps.w.org/cookie-law-info/assets/icon.svg?rev=3007243)
 * [CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)](https://wordpress.org/plugins/cookie-law-info/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-law-info/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-law-info/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-law-info/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-law-info/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-law-info/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Nick](https://wordpress.org/support/users/nickcysupport/)
 * Last activity: [6 months ago](https://wordpress.org/support/topic/malformed-sql-statements/#post-18737781)
 * Status: resolved