Dublicate entry 'ID' for key 'PRIMARY'

Results 1 to 3 of 3
  1. #1
    Enthusiast MuffinCat12 is offline
    MemberRank
    Jan 2016 Join Date
    SentozlandLocation
    38Posts

    Dublicate entry 'ID' for key 'PRIMARY'

    Hey everyone, iv been trying to fix this dublicate bug, which i got after i was trying to register/login on my site, i'v been googling alot to find a fix but didnt find anything that actually helped me. Does someone know how to patch/fix this? I'v tryed to change my ID and tryed to reinstall my database an all that shit, but still ends up with this bug. My db is clean, so idk why the hek this is comming..

    - link from INDEX
    Screenshot by Lightshot

    Thank you for using your time to help me!


  2. #2
    Apprentice BetaJedi is offline
    MemberRank
    Apr 2014 Join Date
    UKLocation
    22Posts

    Re: Dublicate entry 'ID' for key 'PRIMARY'

    It's not a perfect fix, but if you've used a pre-written SQL script to set up all your tables, you may want to empty and truncate your users table, which will restart the numbering scheme. Of course, this only works if you don't really care about losing your members.

    If you did this, I'd recommend doing it on all sub "users_" tables and on "rooms" and "items" too. Sorry if this isn't a good answer!

    Edit: Just an after-thought, you could export the SQL for these tables, make the numbering scheme correct if you wanted to (could use excel?), emptying and truncating the tables, then running the new INSERT query with the correct numbering scheme.

  3. #3
    Enthusiast MuffinCat12 is offline
    MemberRank
    Jan 2016 Join Date
    SentozlandLocation
    38Posts

    Re: Dublicate entry 'ID' for key 'PRIMARY'

    Hey, thank you very much for your try-out fix, idk what the hek happend for it, but now it simply works, i tryed to do what you told, about refreshing the tables, but after that i still had that god damn error. I tryed to patch out my website, and changed it down for another version of ShockCMS, which fixed the problem, after that i tryed to put back the newer version, where it just gave me the error again.

    So i ended up trying to reinstall my database an SQL system, which seems to made it working correctly again, now i just have the bug about /user/username dosnt work correctly XD

    - I guess your fix might be another very working fix. Thank you!



Advertisement