Zen Cart Logo
Forums / General Questions / Field doesn't have a default value

Field doesn't have a default value

Views: 1,934

Results 1 to 2 of 2
13 Jul 2016, 2:58 PM
#1
joshs avatar

joshs

New Zenner

Join Date:
Dec 2010
Posts:
15
Plugin Contributions:
0

Field doesn't have a default value

Hi,

Suddenly my Zen-Cart is giving this error when a new customer tries creating an account:

1364 Field 'customers_gender' doesn't have a default value
in:
[INSERT INTO zencustomers (customers_firstname, customers_lastname, customers_email_address, customers_nick, customers_telephone, customers_fax, customers_newsletter, customers_email_format, customers_default_address_id, customers_password, customers_authorization) VALUES ('XXXx', 'XXXXx', '[email protected]', '', '9999999999', '', '0', 'TEXT', '0', '7176b007a59e92c2b749d218243fd238:87', '0')]

My web host recently moved the site to a new server, but they tell me this is a code issue. Nothing else has changed recently.

When I change the table default value for customers_gender to null, it works, but I then get the same error for customers_referral. Change that default to null, and I get the same error for customers_paypal_payerid.

Any help is greatly appreciated!

13 Jul 2016, 3:29 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Field doesn't have a default value

Chances are that your host's "move to a new server" DID in fact change something significant: the MySQL software version, or at least its operating mode ..... and now it's enforcing some of the stricter rules that newer MySQL versions enforce out-of-the-box.

  1. The BEST fix is to upgrade to a modern version of Zen Cart that works with your more modern version of MySQL. Your Zen Cart version is ancient.

  2. a TEMPORARY bandage is to set default values on those respective fields, after carefully inspecting what a suitable sane default would be for each.