Jump to content

How can I remove this “no-duplicate” constrict ion?


Betty_S

Recommended Posts

Hi,

 

I got this error massage:

 

Duplicate entry '135' for key 1 SQL=

INSERT INTO mos_comprofiler ( `id`,`user_id`,`approved`… VALUES ( '135','135','1','1','…

It’s ok with me if ‘id’=’id_user’, How can I remove this  “no-duplicate” constrict ion?

 

Thanks.

It's not telling you that you can't have 'id = id_user', it's telling you that whichever column you have set as your PRIMARY KEY already has the value that you are trying to insert. So, I would hope your `id` column is your primary key. The error is telling you that you already have a record with the ID of 135, so you can't have it again. You either need to declare another value for the primary key, or if you are using an auto_increment value, you can simply leave that value off your arguments, and one will be generated for you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.