This is the error message SQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Forum Newbie
Posts: 1
Joined: Sun Dec 17, 2017 12:57 am

This is the error message SQL

Post by vienkr »

This is the error message:
1002 - Duplicate entry '' for key 'products_model'

update NEWS set products_quantity = '1', products_model = '', products_price = '', products_type = '0', products_date_available = null, products_weight = '0', products_status = '', products_tax_class_id = '', manufacturers_id = '0', products_last_modified = now() where products_id = '141'

I tried to edit the data but not. Who answers help to crime. I have to complete the weekend to complete the project . Help me please
Last edited by requinix on Sun Dec 17, 2017 1:49 am, edited 1 time in total.
Reason: removing link
User avatar
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: This is the error message SQL

Post by requinix »

It means the NEWS table requires all products_model values to be unique. One of each.

Either provide a value for the products_model, which means you probably need to fix the other row which is also empty, or decide whether the uniqueness constraint needs to be there.
Forum Newbie
Posts: 7
Joined: Sat Aug 07, 2021 1:42 am

Re: This is the error message SQL

Post by kiash »

You have made products_model field as unique property. thats why you are getting this error. I you do not required this field as unique then alter the unique attribute
I am a full stack developer. My persoal site and I work for as a lead developer.
User avatar
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC

Re: This is the error message SQL

Post by Vegan »

this forum and WP all use a document ID that is a simple counter to make sure each row in a database is present

I suggest adopting the same idea
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply