Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2011
    Posts
    106
    Plugin Contributions
    0

    database error Error message when creating an account

    Hi

    When ever I create a new account I get this error on a blank screen:

    WARNING: An Error occurred, please refresh the page and try again.

    If I refresh, it returns me back to the 'create an account' page, but in actual fact it has created an account for the customer and is logged in as the new customer.
    I pulled the error message from my cache file too:

    [**-**-**23:52:05] PHP Fatal error: 1062: Duplicate entry '46' for key 'PRIMARY' :: insert into znc_customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_date_of_last_logon, customers_info_source_id) values ('46', '0', now(), now(), '1') in /****/****/public_html/****/includes/classes/db/mysql/query_factory.php on line 101


    This is not a live site yet so I have deleted all customers as well as gone into phpMyAdmin and clear all data in 'customers_info' table, checked for entries in 'customers' and 'customers_basket' tables as well as 'address_book'.

    I can't seem to find anywhere the duplicate ID number it claims is, so if anyone could kindly help I would be so grateful.

    Thanks,
    Jay

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error message when creating an account

    If you are trying to delete ALL customers, you should do a truncate on all the tables for Customers:
    address_book
    customers
    customers_info
    customers_basket
    customers_basket_attributes

    and if you used any related tables on creating Orders, GVs, Coupons etc. those tables also should be cleaned up to remove any customer data ...

    In phpMyAdmin, when you look at the table structure, you will see the:
    Next Autoindex

    and it sounds like yours are still set and causing the conflict ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jul 2011
    Posts
    106
    Plugin Contributions
    0

    Default Re: Error message when creating an account

    Hi Ajeh

    Thanks for the reply, I actual got my original idea of trying to solve the problem through another thread which you mentioned doing a similar thing.

    I have now truncated of these tables:
    address_book
    coupons
    coupon_email_track
    coupon_gv_customer
    coupon_redeem_track
    customers
    customers_info
    customers_basket
    customers_basket_attributes
    orders
    orders_products
    orders_status_history
    orders_total
    product_notifications

    Pretty much all I could find that would be related to a customer and there history.

    But still no luck.

    I tried to find the 'Next Autoindex' but could only see 'Auto Increment' against the customers ID in 'customers' table, which I tried out but error still came up and did as expected with the ID numbers. So put it back in place.

    One thing that I should mention that may or may not have an effect is that I have the COWOA (checkout without an account) module installed. Not sure if this has much of effect on problem as tables are cleared and I the only thing related is a column in the in the 'customers' table.

    If you know anything else or have any suggestion, I would love to hear them.
    Thanks,
    Jay

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error message when creating an account

    I am assuming when you list those table names that they all have the prefix on them of znc_ that you were showing in your error?

    What happens if you turn off the COWOA?

    If you look at, in phpMyAdmin, the structure of the table:
    admin_activity_log

    Down at the bottom of the screen, do you see a section called:
    Row Statistics

    if so, in that table do you see:
    Next Autoindex

    If so, if you look at the table structures of the tables that you have emptied, do you see that section?

    If so, for any that include the Next Autoindex, are they set to 1? (note: not all tables will have this Next Autoindex)
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jul 2011
    Posts
    106
    Plugin Contributions
    0

    Default Re: Error message when creating an account

    Yes you assuming right, they all are prefixed znc_

    I switch off COWOA, but still comes up with same error.

    RE Next Autoindex, they are showing a 1 when truncated, but for the the table you mentioned 'admin_activity_log' I have not truncated this one, but it's Next Autoindex does reflect the next ID that would follow in the table i.e last number in table = 3220 .... autoindex = 3221.

    Would truncating this table perhaps help?

    Not to sure if this has anything to do with it but in some table e.g. 'customers_info' down at the bottom under 'space usage', I have 'Overhead' in red with the option to optimize the table. Would this be something that could be causing an error?
    Last edited by 4jDesigns; 5 Jan 2013 at 06:06 PM. Reason: Update

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error message when creating an account

    It would not help to truncate the admin_activities_log that was more for an example that you can test on truncating and what the Next Autoindex and easily populate the file by just navigating in your Zen Cart Admin to see the changes to it ...

    You are sure that the database you are working with is the database that the site is using, correct?

    Could you delete all of your debug logs on the server then trigger the error and check the contents of the current debug log just to make sure nothing has changed on this issue?

    NOTE: be sure to refresh in FTP the files on the server so that you are looking at the most recent debug logs ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jul 2011
    Posts
    106
    Plugin Contributions
    0

    Default Re: Error message when creating an account

    Yip defo the database I am using because I can cross reference between whats in the admin section and whats in the database when I add and delete info.

    Cleared all log files and redid, this is what the latest says:

    [05-Jan-2013 12:45:50] PHP Fatal error: 1062 : Duplicate entry '1' for key 'PRIMARY' :: insert into znc_customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_date_of_last_logon, customers_info_source_id) values ('1', '0', now(), now(), '3') in /*****/*****/public_html/apini/includes/classes/db/mysql/query_factory.php on line 101

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Error message when creating an account

    Check the structure of your table:
    znc_customers_info

    IF it matches this one, run this in the SQL:
    Code:
    DROP TABLE IF EXISTS znc_customers_info;
    CREATE TABLE znc_customers_info (
      customers_info_id int(11) NOT NULL default '0',
      customers_info_date_of_last_logon datetime default NULL,
      customers_info_number_of_logons int(5) default NULL,
      customers_info_date_account_created datetime default NULL,
      customers_info_date_account_last_modified datetime default NULL,
      global_product_notifications int(1) default '0',
      PRIMARY KEY  (customers_info_id)
    ) ENGINE=MyISAM;
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Jul 2011
    Posts
    106
    Plugin Contributions
    0

    Default Re: Error message when creating an account

    Only got one more column, customers_info_source_id. This is for the 'How did you hear about us' mod by Dr Byte. I took note of the values and added it to your SQL command.
    So mine looked like this
    Code:
    DROP TABLE IF EXISTS znc_customers_info;
    CREATE TABLE znc_customers_info (
      customers_info_id int(11) NOT NULL default '0',
      customers_info_date_of_last_logon datetime default NULL,
      customers_info_number_of_logons int(5) default NULL,
      customers_info_date_account_created datetime default NULL,
      customers_info_date_account_last_modified datetime default NULL,
      customers_info_source_id int(11) default none,
      global_product_notifications int(1) default '0',
      PRIMARY KEY  (customers_info_id)
    ) ENGINE=MyISAM;

  10. #10
    Join Date
    Jul 2011
    Posts
    106
    Plugin Contributions
    0

    Default Re: Error message when creating an account

    Ajeh, managed to get it fixed.. well sort of. After posting my previous comment I realized that perhaps it may just be the 'how you hear about us' mod. So I have commented out the relevant lines out of the modules and templates files regarding the mod and creating an account works brilliant now...
    Will do a fresh install of the mod to see if it fixes itself up otherwise I think I will need to jump to Dr Bytes thread.

    Thanks so much for your help so far.

    Jay

 

 

Similar Threads

  1. 1064 syntax error when creating account
    By mayleine in forum General Questions
    Replies: 3
    Last Post: 2 Jan 2011, 11:31 AM
  2. Error when creating an account.
    By Graphicman in forum General Questions
    Replies: 4
    Last Post: 23 Aug 2010, 10:33 AM
  3. Error when creating new account
    By sinsor in forum Managing Customers and Orders
    Replies: 1
    Last Post: 17 Nov 2009, 10:14 PM
  4. [NOT A BUG] Warning message when creating new account.
    By CobraPlant in forum Bug Reports
    Replies: 4
    Last Post: 24 Nov 2007, 06:59 AM
  5. Getting error when creating account
    By shastaMatt in forum General Questions
    Replies: 2
    Last Post: 24 Apr 2007, 08:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR