Jump to content


Photo

Update All Products In Database


  • Please log in to reply
3 replies to this topic

#1 jimbobsquarepants

jimbobsquarepants
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 23 October 2006 - 10:26 AM

I work for a mail order company that supply books, from the start of next year book ISBN numbers are changing from 10 to 13 digits. Our product code is a letter say 'M' and then the last 5 digits of the ISBN so ... M12345. That means that when the new ISBN stuff happens that will need to be changed. Also we have the ISBN in the database so that will need to be changed. In the database there are two tables that need their data updating, 'products' needs 'products_model' (the ISBN) updating and 'products_description' needs 'products_code' (you can guess ... our product code) updating.

At the begaining of next year i'll be given a shreadsheet. The website is powered by osCommerce and we have around 24,000 products on there that will need updating at the start of next year  :(

Hope you get what im trying to do lol

So if you guys could point me in the right direction i'd be happy  ;D

Thanks for your time.

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 24 October 2006 - 02:37 AM

Well, provided that you update the "products" table, you can update all the related tables accordingly
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 jimbobsquarepants

jimbobsquarepants
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 24 October 2006 - 07:55 AM

Ok, how would be the best way to go about updating that table?

Cheers

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 24 October 2006 - 03:35 PM

Well, I'm assuming that you have some sort of one-to-one conversion from the existing numbers to the new numbers... if so, simply import these data into a new table, with product_id, oldISBN, newISBN, and then you can issue multi-table updates to take care of the rest.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users