Jump to content

Integrating Datas to one database using php script


xavienkenny

Recommended Posts

Hello everybody, I have found a lot of amazing advises and codes to improve on my existing codes. It seems to be an awesome site. I actually came from a background of Application programming, however I have just recently pick up a project in php. The project is about database integration, where I have to integrate 5 supplier's existing data who have different attributes into one. (each suppliers have about 30k data)  I really need help and advises on how should I do the script.

 

Here's the details, All the suppliers uses different data file, such as CSV and .xls. I am finding a way to integrate all the 5 files into one database(mysql/phpmyadmin) so it could be listed out in a shopping cart or catalog in future. However, I am unfamiliar with php, so please advice on how can i go about fixing this problem. The first problem is that each individual suppliers uses a different attributes name, for example

 

Supplier 1 uses : SupplierName, SupplierID, SupplierAddress, Status

 

Inside the status, the supplier uses data such as, Good, Excellent, Great

 

while Supplier 2 uses : SName, SID, SAddress, Status

and inside this supplier, the status data that are being uses is G, Ex, Gr.

 

How can I set a consistancy on the data and converting all the properties into one so I can import this data into a proper database such as mysql/phpmyadmin. Please help, thanks in advance

Link to comment
Share on other sites

If you are using phpmyadmin you could just import the data from each spreadsheet / csv through the phpmyadmin panel, as long as the columns are in the same order for each spreadsheet then the column names are not needed for the import.

 

Once all the data is imported it should only take a couple of queries to standardise the data :

UPDATE tablename SET status = 'good' where status = 'g' .... Etc 

Again only do this if you only need to do it as a one off , otherwise a more rigerous script would be needed. Only a suggestion , hope it helps

Link to comment
Share on other sites

hi gristoi, thank you for replying,

 

the problem that I'm having is that, i have 5 suppliers, each of them are given a ftp directory so they can upload their data.

 

when the data is uploaded, my script will read the data file (.csv) and store all the data into the database.

 

The problem is that, every supplier has different properties name for their data, example, (S_Name, S_Address, S_Status, S_Availability);

 

I want to write a script to format the properties, so when the csv file is being read,

 

S_Name (from csv) will be stored into Supplier_Name(to database).

S_address(from csv) will be stored into supplier_Address(to database).

S_Status(from csv) will be stored into supplier_Status(to database).

S_Availability(from csv) will be stored into supplier_Availability(to database).

 

then, i would want to set a consistancy on data which is, availability could be Monday in supplier 1, whereas in Supplier 2, the availability might be Mon

 

i want it to be standardize to MONDAY so, how can i write a script to do that, if

data is Mon or Monday, set to MONDAY?

 

 

thanks

 

by the way, the script will only read on a specific time by cron.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.