MySQL Forums
Forum List  »  PHP

PHP & mySQL Upload Question?
Posted by: Bernardo Gago
Date: January 13, 2009 04:07PM

Hi,

Ok, for all the PHP & mySQL experts I have a question.

I currently upload my vendor prices & inventory levels to a mySQL table through a PHP page. I use a *.txt file with the following column headings for the upload: UPC#, VendorID, VendorPrice, InventoryLevels.

I have a programmer working on this but I want to make sure he is correct on this issue.

Depending on the vendor; some send me files with just the UPC# and InventoryLevels, some send me files with just the UPC# and VendorPrice, and other send me all the information in one file.

So I need my upload to support 3 different file type uploads:
- UPC#, VendorID, VendorPrice, InventoryLevels
- UPC#, VendorID, VendorPrice
- UPC#, VendorID, InventoryLevels

Currently, the 1st file type with all the vendor information works fine.

However, when I use the file with just the "InventoryLevels" it makes all the data in the VendorPrice change to 0, and if I use the file with just the "VendorPrice" it makes all the InventoryLevels change to 0.

I'm thinking can't he just write code to say for example; if the "VendorPrice" column heading name is not found in the *.txt file it will ignore this column and just update records according to the UPC# and InventoryLevels?

He's telling me if the *.txt file doesn't have the price column included it will make all the data in the price column in mySQL to 0, but there has to be a way around this. It can't be this difficult to do...

Thank you,

olimits7

Options: ReplyQuote


Subject
Written By
Posted
PHP & mySQL Upload Question?
January 13, 2009 04:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.