Title: MySQL error when creating custom table
Last modified: May 9, 2024

---

# MySQL error when creating custom table

 *  Resolved [codi0](https://wordpress.org/support/users/codi0/)
 * (@codi0)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/mysql-error-when-creating-custom-table/)
 * Running WordPress 6.5, php 8.1 and MySQL 8.0 on an openlitespeed server.
 * I’ve just installed pods on a clean WordPress install to test it out. I’ve enabled
   the Advanced Content Type component and attempted to create a custom data structure
   called “company” in the admin UI.
 * When trying to create the table, it throws a MySQL error:
 * `Error: Database Error; SQL: CREATE TABLE wp_5_pods_company (id BIGINT(20) UNSIGNED
   AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), created DATETIME NOT NULL default"
   0000-00-00 00:00:00", modified DATETIME NOT NULL default "0000-00-00 00:00:00",
   permalink VARCHAR(200)) DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
   Response: 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 '"0000-00-00 00:
   00:00", modified DATETIME NOT NULL default "0000-00-00 00:00:00' at line 1`
 * When trying to run the CREATE TABLE sql statement manually, I found that it was
   failing due to the double-quotes around the DATETIME default values. The sql 
   executes correctly when replacing the double-quotes with single-quotes.

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

 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/mysql-error-when-creating-custom-table/#post-17744080)
 * I thought we had caught all of the double quote usage already. I’ll look at getting
   this fixed for the next release.
 * Double quotes doesn’t work on all servers and in the past we did a review to 
   fix any of those usages.
 *  Thread Starter [codi0](https://wordpress.org/support/users/codi0/)
 * (@codi0)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/mysql-error-when-creating-custom-table/#post-17744091)
 * Thanks for the quick response. I’ll look out for the next version. 🙂
 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [2 years ago](https://wordpress.org/support/topic/mysql-error-when-creating-custom-table/#post-17746418)
 * Fixed in the upcoming Pods 3.2.2 release, you can see the changes here: [https://github.com/pods-framework/pods/pull/7285](https://github.com/pods-framework/pods/pull/7285)
 * No ETA on release timing as I’m still gathering more fixes for that. Possibly
   end of May but depends on how these last few weeks of school go for my kids (
   it’s a crazy time!)

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

The topic ‘MySQL error when creating custom table’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/mysql-error-when-creating-custom-table/#post-17746418)
 * Status: resolved