Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Posts
    351
    Plugin Contributions
    4

    Default Re: 1062 Duplicate entry '0' for key 1

    Quote Originally Posted by FredZ View Post
    I have just replaced my entire database with the original and now I have the followinf error when I go to the admin panel.


    1062 Duplicate entry '0' for key 1
    in:
    [insert into zen_admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '0', 'login.php ', '', '192.168.0.215')]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

    This error appears after I have entered the login details and will not dissapear at all.

    The store itself functions as expected. just that I can no longer access the admin panel.

    Any comments woulds be most helpfull
    The only thing that I can see that can't be duplicated is the log_id which is auto_incremented. If you have phpmyadmin to look at the database, check the admin_activity_log table and see what your last log_id is, then click on the operations tab and see what the AUTO_INCREMENT number is set to. If it is a number that already exists, set it one higher than the last one in the database.

  2. #2
    Join Date
    Jan 2007
    Posts
    66
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '0' for key 1

    I am guessing that the problem stems from me clearing the admin_activity_log table.

    is there any way I can resolve that?

    Regards

    Fred

  3. #3
    Join Date
    Apr 2008
    Posts
    351
    Plugin Contributions
    4

    Default Re: 1062 Duplicate entry '0' for key 1

    Quote Originally Posted by FredZ View Post
    I am guessing that the problem stems from me clearing the admin_activity_log table.

    is there any way I can resolve that?

    Regards

    Fred
    You restored the database and then cleared the log or cleared the log and then restored the database?

    Everything that you do in the admin pages are put into the activity log.

    Do you have phpMyAdmin? If you do, click on the admin_activity_log and then click on empty. MAKE SURE you have admin_activity_log highlighted before you click on empty. You will get a warning when you do, but it will clear it out and set it up for the next entry number.
    I just tried it and it worked fine.

    If you only have access to the mysql program in say terminal mode, login to the mysql (requires knowledge of how to login with id. Change it to your database: use DATABASE_NAME;

    then issue this command.

    truncate admin_activity_log;

    This will also clear the table of all entries.

  4. #4
    Join Date
    Jan 2007
    Posts
    66
    Plugin Contributions
    0

    Default Re: 1062 Duplicate entry '0' for key 1

    Well it seems I may have muffed things here, so I am just going to have to rebuild the entire site from scratch again. Probably a better thing regardless of the hours.

    I can't get acces to the admin panel regardless of the database I import.

    Thanks for the comments anyway.

    Regards

    Fred

 

 

Similar Threads

  1. 1062 Duplicate entry '11' for key 1
    By Sarah_77 in forum General Questions
    Replies: 5
    Last Post: 26 Dec 2011, 03:06 AM
  2. 1062 Duplicate entry '38' for key 1
    By henryvuong in forum General Questions
    Replies: 1
    Last Post: 16 Jan 2008, 06:40 AM
  3. 1062 Duplicate entry '0' for key 1
    By knitengale in forum General Questions
    Replies: 8
    Last Post: 12 Jul 2006, 12:50 AM
  4. 1062 Duplicate entry '0' for key 1
    By marckasten in forum General Questions
    Replies: 3
    Last Post: 12 Jun 2006, 06:19 PM

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