Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Pelvis

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. 

Link to comment
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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...