VWinterswijk Posted yesterday at 11:36 AM Share Posted yesterday at 11:36 AM 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. Link to comment Share on other sites More sharing options...
wepresta Posted yesterday at 11:44 AM Share Posted yesterday at 11:44 AM (edited) 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 yesterday at 11:44 AM by wepresta (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted yesterday at 11:57 AM Share Posted yesterday at 11:57 AM Problem come from your customers import, how did you do that? Link to comment Share on other sites More sharing options...
VWinterswijk Posted yesterday at 12:16 PM Author Share Posted yesterday at 12:16 PM (edited) 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? Edited yesterday at 12:29 PM by VWinterswijk (see edit history) Link to comment Share on other sites More sharing options...
VWinterswijk Posted yesterday at 12:21 PM Author Share Posted yesterday at 12:21 PM (edited) 31 minutes ago, Prestashop Addict said: Problem come from your customers import, how did you do that? Empty the existing data, and copy the data without the structure to the new database. Edited yesterday at 12:29 PM by VWinterswijk (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted yesterday at 12:38 PM Share Posted yesterday at 12:38 PM (edited) il y a 16 minutes, VWinterswijk a dit : Empty the existing data, and copy the data without the structure to the new database. How did you copy, insert sql command? If so make sure customer_id is null and not 0 Edited yesterday at 12:38 PM by Prestashop Addict (see edit history) Link to comment Share on other sites More sharing options...
VWinterswijk Posted yesterday at 03:21 PM Author Share Posted yesterday at 03:21 PM Not able to add auto increment Link to comment Share on other sites More sharing options...
wepresta Posted yesterday at 03:22 PM Share Posted yesterday at 03:22 PM 1 minute ago, VWinterswijk said: 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 More sharing options...
VWinterswijk Posted yesterday at 03:59 PM Author Share Posted yesterday at 03:59 PM SOLVED 1. Installed an blanc version of prestashop. 2. Deleted costumer and costumer group from my clone. 3. copied structure with auto increment to clone database from the blanc version 4. deleted the version form my live shop and copied the new data also with auto increment to the live shop 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now