Jump to content

Edit History

wepresta

wepresta

Hi,

That usually happens when the ps_customer table lost its AUTO_INCREMENT / PRIMARY KEY setup during the import, so new inserts end up with id_customer = 0 (or fail to generate a new ID).

1. Verify the column definition

SHOW CREATE TABLE ps_customer;

Make sure id_customer is INT ... NOT NULL AUTO_INCREMENT and is the PRIMARY KEY.

2. Reset the AUTO_INCREMENT to the next valid value

SELECT MAX(id_customer) FROM ps_customer; ALTER TABLE ps_customer AUTO_INCREMENT = <max+1>;

3. If you have a bad row with ID 0, remove it (after checking what it is):

SELECT * FROM ps_customer WHERE id_customer = 0; -- then delete if appropriate

After that, try registering a new customer again.

wepresta

wepresta

Hi,

That usually happens when the ps_customer table lost its AUTO_INCREMENT / PRIMARY KEY setup during the import, so new inserts end up with id_customer = 0 (or fail to generate a new ID).

Quick checks/fix (in your database):

1. Verify the column definition

SHOW CREATE TABLE ps_customer;

Make sure id_customer is INT ... NOT NULL AUTO_INCREMENT and is the PRIMARY KEY.

2. Reset the AUTO_INCREMENT to the next valid value

SELECT MAX(id_customer) FROM ps_customer; ALTER TABLE ps_customer AUTO_INCREMENT = <max+1>;

3. If you have a bad row with ID 0, remove it (after checking what it is):

SELECT * FROM ps_customer WHERE id_customer = 0; -- then delete if appropriate

After that, try registering a new customer again.

×
×
  • Create New...