1062 - Duplicate entry '' for key 2 error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saadsinpk
    New Member
    • Jan 2010
    • 12

    1062 - Duplicate entry '' for key 2 error

    hi i have website http://www.rougejaunevert.com/www/ , i want to join my forum phpbb http://www.rougejaunevert.com/www/forum and my website http://www.rougejaunevert.com/www/ , i have join db of both, and make one table, now i try to register it give this error
    1062 - Duplicate entry '' for key 2
    Code:
    insert into phpbb_users (user_name, user_email, user_forname, user_nickname, user_gender, user_birthday, username, user_password, user_image, user_ip, user_status) values ('saad', 'email@yahoo.com', 'iqba', '5481515', 'Mlle', '11-12-1943', 'saad_sinpk', '4c76827a270ec72b6506b4bada3bf731', 'e80f2021abfd74faf4f533bc8c875b36.jpg', '119.63.136.101', 'active')
    [TEP STOP]


    help me please it is urgent
    Last edited by Atli; Jan 30 '10, 08:53 AM. Reason: Added [code] tags.
  • dgreenhouse
    Recognized Expert Contributor
    • May 2008
    • 250

    #2
    There's obviously a record already in the phpbb_users table for at least 1 of the values you're trying to insert - and that column has a 'uniquess' constraint set.

    You said you've combined two tables into 1... Probably not a good idea unless you really know what you're doing...

    What is the second index key for your modified table?

    I noticed that some of your column names are not part of the default phpbb_user table definition...

    Hope you have a backup of the original tables...

    Comment

    • saadsinpk
      New Member
      • Jan 2010
      • 12

      #3
      can u please add me <email_remove d> and come in my pc by teamviewer and sort me out i am totally confuse please help me :((
      Last edited by Dormilich; Jan 29 '10, 01:47 PM. Reason: removed email address - for your own safety

      Comment

      • dgreenhouse
        Recognized Expert Contributor
        • May 2008
        • 250

        #4
        I don't mean to be rude, but you've only made 2 posts so far. As you hopefully understand, I'm reluctant to expose my network to just anyone - I've got too much time and money invested in my infrastructure.

        Helping is one thing... Doing the work for you is another...

        Comment

        • saadsinpk
          New Member
          • Jan 2010
          • 12

          #5
          can u just add me on yahoo or by any other way by which we can talk directly , please help me i am not hacker or any other bad guy, i just need your help

          Comment

          • saadsinpk
            New Member
            • Jan 2010
            • 12

            #6
            here is my table of phpbb_user





            there are 3 index file
            i have original backup please tell me what i do ?
            i want to make similar site <Link to commercial site removed>
            Last edited by Atli; Jan 30 '10, 09:13 AM. Reason: Removed the link. Links to commercial sites are not allowed. Besides, it didn't really help.

            Comment

            • dgreenhouse
              Recognized Expert Contributor
              • May 2008
              • 250

              #7
              Your not inserting a unique value for username_clean. username_clean has a UNIQUE index constraint set. I assume you might have some other issues, but that's the first thing to correct.

              See: http://www.phpbb.com/search/?q=+utf8_clean_string

              You also should run the username through utf8_clean_stri ng() creating username_clean before the insert.

              You can do it without the function (roll your own), but the included functionality is handy.

              Comment

              • saadsinpk
                New Member
                • Jan 2010
                • 12

                #8
                i did not understand what you are saying but i see that when i delete one register user then i try to register it allow me to register, now what i do this username_clean was already in php forum , what i do that if any one register there name show in username_clean also please help me i will be thank full you

                Comment

                • dgreenhouse
                  Recognized Expert Contributor
                  • May 2008
                  • 250

                  #9
                  How much programming experience do you have?
                  Are you using the actual bulletin-board application?
                  Or are you just using the database from phpBB?
                  _______________ _______________ _______________

                  What I was saying in my last post was that you are not including a unique value to the column: username_clean.

                  I can assume since you did not include username_clean in the query that it is trying to insert whatever the DEFAULT value for that column is - on every insert. That being the case; and since there is a "unique index" set for that column, you'd get an error on the second insert.

                  You have to include a UNIQUE value for username_clean and it would normally be the value of username passed through the filter utf8_clean_stri ng(). utf8_clean_stri ng() is function that is included with phpBB in the file: /includes/utf/utf_tools.php that comes with phpBB.

                  As a matter of fact, username should be unique also, but username_clean; I'm guessing, is used to normalize different unicode characters

                  That is $username_clean = utf8_clean_stri ng($username).

                  I am no phpBB expert, so my observations are at the very limited level, but I have mucked around with it a little.

                  I'm afraid to say that you're really going to have to buckle down and learn what you're doing before tearing things apart and putting them back together in un-tested ways. [ I've done it many times though ;-) I guess that's how I learned - by TERROR! ]

                  Sorry if I'm making an assumption about your abilities. Are you in Ghana?

                  _______________ _______________ _________

                  From the page: http://area51.phpbb.com/docs/code/ut...8_clean_string

                  utf8_clean_stri ng (line 1817)
                  This function is used to generate a "clean" version of a string.

                  Clean means that it is a case insensitive form (case folding) and that it is normalized (NFC). Additionally a homographs of one character are transformed into one specific character (preferably ASCII if it is an ASCII character).

                  Please be aware that if you change something within this function or within functions used here you need to rebuild/update the username_clean column in the users table. And all other columns that store a clean string otherwise you will break this functionality.

                  return: Cleaned up version of the input string
                  string utf8_clean_stri ng (string $text)
                  string $text: An unclean string, mabye user input (has to be valid UTF-8!)

                  Comment

                  • saadsinpk
                    New Member
                    • Jan 2010
                    • 12

                    #10
                    sir i don't have enough programming experience i am new to this , if you will help me i will be a great fan of you, i will do any thing for you , just solve my problem a big problem

                    Comment

                    • dgreenhouse
                      Recognized Expert Contributor
                      • May 2008
                      • 250

                      #11
                      I can't really solve your problem without you knowing what your problem is...

                      Comment

                      • dgreenhouse
                        Recognized Expert Contributor
                        • May 2008
                        • 250

                        #12
                        If you can do it, I'd recommend setting things back to the point where it was working.

                        Then, you can figure out the best way to move forward - be it further study, getting help from others more experienced to TRULY implement the functionality desired, etc.

                        But you're really in a pickle at the moment; unless you only made minor changes.

                        Is this for your job in your country?

                        Be honest...

                        The site looks very political and I know how it can be when politcal types are involved.

                        Comment

                        • saadsinpk
                          New Member
                          • Jan 2010
                          • 12

                          #13
                          can u just check problem, by coming in my pc, please don't resolve all problem just help me, can u come in my pc by teamviewer and then you check and tell me please

                          Comment

                          • dgreenhouse
                            Recognized Expert Contributor
                            • May 2008
                            • 250

                            #14
                            As I mentioned earlier, I'm not willing to do that at this point. Plus, I'm about to "go dark" and work on a very dense project - after getting some sleep; after being up for over 36 hours...

                            Comment

                            • dgreenhouse
                              Recognized Expert Contributor
                              • May 2008
                              • 250

                              #15
                              Sorry - Guinea or more appropriately: République de Guinée...

                              I really feel for you, but I'm unwilling to expose myself. I believe you're probably okay, I'm just worried about the ones who might be watching who are not. Plus as stated, I don't have the time right now...

                              Comment

                              Working...