Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

customer create account error


ce7

Recommended Posts

hi,

have CE1.0.5.0, testing to register new customer account, it will write into database, but it keep showing error message
Fatal 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

image.png.eab23e4914c6a8cd0850c7caff98a14a.png

how can I resolve the error issue?

Many thanks!  Lyn

Link to comment
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...