ce7 Posted May 4, 2020 Share Posted May 4, 2020 hi, have CE1.0.5.0, testing to register new customer account, it will write into database, but it keep showing error messageFatal error: Uncaught mysqli_sql_exception: Duplicate entry '3' for key 'PRIMARY' in /mywebsite.com/includes/functions/database.php:52 Stack trace: #0 /mywebsite.com/includes/functions/database.php(52): mysqli_query(Object(mysqli), 'insert into cus...') #1 /mywebsite.com/create_account.php(325): tep_db_query('insert into cus...') #2 {main} thrown in /mywebsite.com/includes/functions/database.php on line 52 The create_account.php(325) code is: tep_db_query("insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())"); and this is the database table CUSTOMERS structure how can I resolve the error issue? Many thanks! Lyn Link to comment Share on other sites More sharing options...
ce7 Posted May 5, 2020 Author Share Posted May 5, 2020 Found out my problem that causing the issue. I had installed newsletter subscription, and the code i modified was incorrect as tep_db_perform(newsletter_subscription, $sql_subscribe_newsletter); the correct code should be tep_db_perform('newsletter_subscription', $sql_subscribe_newsletter); then the error gone! Lyn Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.