xavienkenny Posted April 16, 2011 Share Posted April 16, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/233866-integrating-datas-to-one-database-using-php-script/ Share on other sites More sharing options...
gristoi Posted April 16, 2011 Share Posted April 16, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/233866-integrating-datas-to-one-database-using-php-script/#findComment-1202270 Share on other sites More sharing options...
xavienkenny Posted April 16, 2011 Author Share Posted April 16, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/233866-integrating-datas-to-one-database-using-php-script/#findComment-1202279 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.