Results 1 to 3 of 3

 

Thread: CSV Files

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Oct 2011
    Posts
    71
    Thanks
    26
    Thanked 1 Time in 1 Post


    Please move this if i've posted it in the wrong place!

    I've got a few questions regarding CSV files and MySQL (i'm new to both but feel like i'm getting somewhere).

    So i've been setting up a database and uploading my merchants CSV files so that I can retrieve the prices to display on my website.

    Am I right in thinking that product_id will always stay the same for a particular product when an updated file is available? As this is what I am linking to, to retrieve the prices.
    I've checked a new CSV file with an old 1 and it seems as though they always stay the same. But i'd rather make sure before I go ahead any further!

    Also, when comparing a new CSV file with an old 1, there are a few products on the old 1 that aren't available on the new 1. Is it possible to upload a CSV file to the database to overwrite the existing table, but keep any products that aren't listed on the new CSV file.

    Hope all that makes sense! Thanks in advance!

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Mar 2007
    Posts
    11
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Hi,

    The product id should stay the same for that merchant.

    The way to do what you are asking would be to check if the product exist in the db. Then you can update if present or insert if new. This would mean old records would be preserved.

    However I would caution you that if a merchant is removing products its probably for a good reason like they are out of stock or no longer sold.

    Hope that helps

    Tim

  3. The Following User Says Thank You to tim_gregg For This Useful Post:

    Lee_K_00 (29-12-11)

  4. #3
    Webber's Avatar
    Registered User

    Status
    Offline
    Join Date
    Aug 2011
    Posts
    79
    Thanks
    3
    Thanked 7 Times in 7 Posts
    Hello,

    1) product_id - well should remain same except it depends who is providing the data. The datassource could change it eg product becomes retired or replaced with newer model etc.

    2) Regarding CVS. It should be possible but depends on what script/code etc you are using - not all will be able to it.

    thx

  5. The Following User Says Thank You to Webber For This Useful Post:

    Lee_K_00 (29-12-11)



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2