Dev Newb
Dev Newb

Reputation: 565

Insert Excel data into MySQL

I've been searching and searching and I'm sure I'm just looking up the wrong thing so I'm looking for a push in the right direction please.

I'm a newbie to PHP and MySQL and my first project has a need to upload excel sheets that contain 20k or so records at varying intervals to an already existing MySQL database. I understand how to do a simple upload and map fields but where I am getting stuck is the excel data is going to two separate tables and the second table has a foreign key for the first table.

I need to find out if the record is a duplicate in table one and if so, get the primary key and insert it into the second table along with some data from the excel sheet.

I'm sure what I'm asking for is very basic but I need to know what the most accepted way to do this is so I can research and build it. I'm not sure if CRUD is what I'm looking for or if I should be running a special SQL statement in PHPMyAdmin?

Im using PHP, MySQL, Godaddy shared hosting for this project. Thx!

Upvotes: 0

Views: 1859

Answers (1)

frosty
frosty

Reputation: 769

Look at PHPExcel for dealing with Excel data - http://phpexcel.codeplex.com/

Upvotes: 2

Related Questions