the previous developer has done a wrong practice in a sql database with phpmyadmin, which is creating a problem of duplicate contents.
Correct way:
table 1
ORDERS
id_order
id_product
table 2
PRODUCTS
id_product
internal_product_code
———
Wrong way:
table 1
ORDERS
id_order
internal_product_code
table 2
PRODUCTS
id_product
internal_product_code
Unfortunately, the internal_product_code is NOT always unique**, while id_product and id_order are always unique. So today my client has get the first duplicate data content, because there's two products with different id_product but same internal_product_code.
** the same internal_product_code due to a very similar specs (this is another bad practice)**
Is there any way to replace table1.internal_product_code with table2.id_product in order to follow the correct way? I need to do it in the database (after a strong backup).
Thanks to all