Jump to content
Sign in to follow this  

do the same as in products_description (duplicated rows for two ids) on another php file

Recommended Posts

Hallo Community!

When we add a new language, in the database some tables (eg products_description) get duplicated ids. For example we have for the same products_id values for both English and german ..the thing is that since in products_id is a Primary key,this seems to violate the uniqueness of the key and generally, Sql throws an error if we try to add a new row with an existing id. So the question is how can we do the same thing (duplicated rows for two ids), in tables apart from those that change when we add a language. 

Edited by Pelvis

Share this post

Link to post
Share on other sites

The products_description table has a multiple column key on products_id and language_id. 

  PRIMARY KEY  (products_id,language_id),

So one row per combination.  I.e. if English is 1 and German is 2, then you can have products_id 1/language_id 1 and products_id 1/language_id 2 but not a second 1/1. 

You could change other tables to have multiple column keys too or even remove the key entirely.  But weird things can happen if the system is relying on the values being unique. 

Always back up before making changes.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this