WooCommerce Serial Numbers getting error “Could not create serial number”

SupportCategory: WooCommerce Serial Numbers ProWooCommerce Serial Numbers getting error “Could not create serial number”
Christoph Eitelhuber asked 3 months ago

Hello,
I am using the Pro Version of WooCommerce Serial Numbers and getting the Error “Could not create serial number”. The error occurred while I added serials manually. Automatic serial number generation also does not work. Is there an error log or other things that I can check? Thank you.

3 Answers
Kibria Staff answered 3 months ago

Hi Christoph,
It appears like the database tables are not created for you. That is why WooCommerce Serial Numbers is failing to create serial numbers for you. What is the version of your database? Please connect with us from the live support section (find the message icon at the right bottom of this page).

Ken Plumb answered 2 months ago

Hi. Your CREATE TABLE query is wrong.
Should be

CREATE TABLE `wp->prefix_wcsn_serial_numbers` (
  `id` bigint(20) NOT NULL,
  `serial_key` longtext COLLATE utf8mb4_unicode_ci,
  `serial_image` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `product_id` bigint(20) NOT NULL,
  `activation_limit` int(9) DEFAULT NULL,
  `order_id` bigint(20) NOT NULL DEFAULT ‘0’,
  `activation_email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT ‘available’,
  `validity` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expire_date` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
  `order_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `created` datetime NOT NULL
);
I kept getting errors about cannot save serial number, and i figured out the table doesn’t exist.

kibria Staff replied 2 months ago

Hi Ken,
Thank you for sharing this. In some minority of cases, our plugin fails to create the database as it expects a higher version of the database. Hope you have successfully solved the problem for you. Our development team will review our query. Thank you.

kim answered 2 months ago

Hi, I tried previous SQL and returns 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 '‘0’,
    `activation_email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT N' at line 7

kibria Staff replied 2 months ago

Hi Kim,
You have a lower version of the database. WooCommerce Serial Numbers requires a minimum version of 5.6 to function properly. We highly recommend you to update your database version from the server. Once you update the database, everything will work smoothly for you. Thank you.

Kim replied 2 months ago

Hi Kibria, I manually created the table and now is working.

Thanks!

kibria Staff replied 1 month ago

That is great but we really recommend you to update your database version. It will keep you on the safe side. Thanks a lot.

Your Answer

12 + 20 =