VWinterswijk Posted 21 hours ago Share Posted 21 hours ago 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 21 hours ago Share Posted 21 hours ago (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 21 hours ago by wepresta (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted 21 hours ago Share Posted 21 hours ago Problem come from your customers import, how did you do that? Link to comment Share on other sites More sharing options...
VWinterswijk Posted 20 hours ago Author Share Posted 20 hours ago (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 20 hours ago by VWinterswijk (see edit history) Link to comment Share on other sites More sharing options...
VWinterswijk Posted 20 hours ago Author Share Posted 20 hours ago (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 20 hours ago by VWinterswijk (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted 20 hours ago Share Posted 20 hours ago (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 20 hours ago by Prestashop Addict (see edit history) Link to comment Share on other sites More sharing options...
VWinterswijk Posted 17 hours ago Author Share Posted 17 hours ago Not able to add auto increment Link to comment Share on other sites More sharing options...
wepresta Posted 17 hours ago Share Posted 17 hours ago 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 17 hours ago Author Share Posted 17 hours ago 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