#1062 - Duplicate entry '23933-27243-0' for key 'membersid'

Discussion in 'MySQL' started by basketmen, Nov 20, 2011.

  1. #1
    Hi guys,

    I have a table, the table name is account,
    its have 2 fields : membersid, and categoryid



    i want to change the categoryid field content, i run this in phpmyadmin :



    but get this error message








    - what should i do so i can change the field content? Please help.
    I already tried changing the field TYPE, from INT, to BIGINT, like other person suggested, but still get that error message

    - this is the screenshot from the field Structure

    [​IMG]
     
    Last edited: Nov 20, 2011
    basketmen, Nov 20, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Changing the field type and changing a field in a record that produces a duplicate index entry are two totally different things. As far as the first one goes, you can't change the categoryid to 2 if there's already a record for memberid 3933-27243-2 with a categoryid of 2.

    Changing the field type won't help - you're still trying to create a duplicate record. For that one memberid, just delete the record that has a categoryid of 1.
     
    Rukbat, Dec 1, 2011 IP