Jump to content

Customer ID 0


VWinterswijk

Recommended Posts

Hi,

I have an issue on my new shop, all seemed to work until new customers tried to register. It looks like its not adding an customer ID. I added customer data from my old store with php. but its not registering new avaible ids.

What can i do to fix this. In my Clone i tried to remove all addes costumers yet this wasnt solving it.

is 0.png

Link to comment
Share on other sites

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.

Edited by wepresta (see edit history)
Link to comment
Share on other sites

  

44 minutes ago, wepresta said:

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.

 

Since i'm not ICT educated I am carefull on what to edit. I'm I at the right place here?Schermafbeelding2026-01-26131401.thumb.png.2d0932275377626ca488d5abeae39f28.png

 

Edited by VWinterswijk (see edit history)
Link to comment
Share on other sites

1 minute ago, VWinterswijk said:

image.thumb.png.3ed2c562ca66f1ce1cca74954af3ed31.png

Not able to add auto increment

Check that id_customer is defined as INT NOT NULL AUTO_INCREMENT PRIMARY KEY, then reset the AUTO_INCREMENT to MAX(id_customer) + 1.
Also make sure there is no row with id_customer = 0, as that can block new inserts.

Once fixed, customer registration should work again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...