Results 1 to 2 of 2

Thread: MYSQL Duplicate entry error

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2009
    Posts
    876

    MYSQL Duplicate entry error

    Hi guys,

    Does anybody know how I can allow duplicated for a field in my mysql database?

    I keep getting this error!

    INSERT INTO `welovera_assets`.`ratingItems` (

    `id` ,
    `Cat` ,
    `uniqueName` ,
    `totalVotes` ,
    `totalPoints`
    )
    VALUES (
    NULL , 'Radio', '2', '0', '0'
    )
    MySQL said:

    #1062 - Duplicate entry '2' for key 'uniqueName'


    Thanks

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: MYSQL Duplicate entry error

    change the table definition... it sounds like the uniqueName field has been tagged with a Unique Constraint ... given that it's called "uniqueName" ... that would make sense... so either you need to change it, keep in mind that if it is also the PKey, that could lead to trouble... even if it isn't the PKey, it's unique for a reason and changing it could have unintended consequences.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width