Duplicate entries in mysql why?

0 like 0 dislike
5 views
Good day, there is a base
bd44fcf34f.png
The structure of it
f2f8b81957.png
Request
INSERT INTO s_products (url,name,brand_id,meta_title,meta_keywords,meta_description) VALUES ((SELECT max(product_id) FROM s_products_categories),'%Name%','0','%Title%','%Title%','%Name%') ON DUPLICATE KEY UPDATE `url` = (SELECT product_id FROM s_products_categories), `name` = '%Title%', `brand_id` = '0', `meta_title` = '%Title%', `meta_keywords` = '%Title%', `meta_description` = '%Name%'

How to do that when adding a record not duplicated name.??
by | 5 views

1 Answer

0 like 0 dislike
Make field 'name' is unique.
by

Related questions

0 like 0 dislike
5 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,759 users