PHP - Read from CSV and build SQL queries

Closed

Description

I have an upload script and I need to make it work with a function that can do the following:

- Read from a CSV file, separator is ","

- The first row in the CSV is the table names, those are the exact same names used in the database in that table so "id" equates to an "id" column in the table same as "city" equates to a "city" column in the table, etc. There are a total of 30 columns in the database table.

- Columns are not in the same order so matching columns regardless of position is needed

- Build an SQL query that UPDATES and INSERTS records from the csv according to the following 2 rules:

* One column is the ID, if the ID is set that means that the record exists and needs to be UPDATEd in the database.

* If the ID field is empty in a row that means that the record doesn't exists and needs to be INSERTED in the database

Just to be clear I have the upload script working and the only thing I need from you is to develop a script that handles the insert and update of the records in the MySQL database as explained above, hopefully in a class/function fashion.

Payment will be 50% when you show me the program working and 50% after I test the code and all possible issues had been resolved.

Skills: MySQL, PHP, Software Architecture

See more: fashion names, build mysql query, SQL queries, build sql, build database sql, update mysql csv php, build city, php upload file csv, update sql file, php table csv, php upload test script, csv update, field fashion, mysql sql function, update insert sql, table queries, csv fashion, php script read table, table csv, update field sql field field, separator, update database records csv file php, mysql empty database, csv table, update sql class php

Project ID: #4310096

Awarded to:

gracebasilior

Hi, I can do it for you. Please see PM!

$40 USD in 1 day
(65 Reviews)
5.5

34 freelancers are bidding on average $80 for this job

toinnisfree

quick pro help. ftp and milestone required.

$135 USD in 2 days
(531 Reviews)
7.9
phpexp

Your requirement is fully clear to me and i am ready to start. I have done such type of work many times. Please check the PMB for details.

$99 USD in 2 days
(165 Reviews)
7.7
RockStone435

I think, I will need the CSV to investigate some details. Moreover, if column position might differ, then do you ensure that there is a header row which contains column names?

$85 USD in 7 days
(308 Reviews)
7.6
rajeshsonisl

Quality work assured. Ready to get started. Thanks.

$200 USD in 1 day
(370 Reviews)
6.9
hoangvandungbk

i can help you this project

$100 USD in 2 days
(260 Reviews)
6.7
wontonesaju

Hi i am providing my quote for this job. based on your specification i am submitting my quote. if possible can i see your csv file? regards saju

$45 USD in 1 day
(165 Reviews)
6.6
onedeepen

Ready to start. Please check PMB for portfolio and other details. regards

$30 USD in 1 day
(36 Reviews)
5.8
dzmitrij

Hello, Can make such a work quickly. Comleted previously many task with csv. Regards. Dima

$30 USD in 1 day
(66 Reviews)
5.7
smartdatasoft

hello, i am ready to do your job. i can do both in asp.net or php i am expert on both.

$150 USD in 2 days
(120 Reviews)
5.7
bogdanperian

Cheers, +5 years experience in Web development ( PHP/SQL) and data processing. I can finish your script today , error free . Let me know if you need my services.

$60 USD in 0 days
(17 Reviews)
5.2
drupal1

Hi, I have experience with process data on CSV file with PHP, I sure 100% I can do it right for you. Please see PMB.

$120 USD in 2 days
(28 Reviews)
5.1
xplorr007

Lets do it right away!!

$50 USD in 1 day
(21 Reviews)
4.8
phpthebest

Hi, I am ready to do this project.

$30 USD in 0 days
(33 Reviews)
4.7
rajibdebslg

Hi, I am very interested for this job.Please check your PMB. Thanks Rajib.

$30 USD in 1 day
(34 Reviews)
4.7
alrazon

Read your details and interested to work, thanks.

$50 USD in 5 days
(29 Reviews)
4.5
shaz123

Hi ===YESS!! WE ARE EXPERT IN WEB DEVELOPING, HTML, XHTML, CSS, JAVASCRIPT, JQUERRY, PHP, SEO, ECOMMERCE, WORDPRESS, JOOMLA, AJAX, DRUPAL,MAGENT,O XML, ANDROID APP,IPAD APP,IPHONE APP. , WE LOVE TO DEVELOP AND DESIGN== More

$250 USD in 7 days
(9 Reviews)
4.6
luantnd

Hi, I can do it quick

$150 USD in 0 days
(35 Reviews)
4.5
alexmoss

Hi, can write such CSV parsing script for you and help test/integrate within 1 day. Please let me know if you're instereated. Thanks, Alex.

$50 USD in 1 day
(2 Reviews)
4.5
WSolutionsinc

Hi sir, please check private message sent. Thank you!

$120 USD in 3 days
(20 Reviews)
4.3
gatiworks

I am an expert in PHP MySQL. Given a chance will do the quality work for sure

$120 USD in 4 days
(34 Reviews)
4.2