"Enhancing a Simple PHP Application" was retired on December 19, 2016. You are now viewing the recommended replacement.

Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Insert Data from Excel Sheet to MySQL Database using PHP

Hello All,

I'm trying to build a web application which will require me to upload large amounts of data from excel spreadsheets on a repeated basis. I am making my application using PHP and MySQL.

I was wondering if anyone could point me to a tutorial/provide some hints regarding how I will be able to insert spreadsheet data into the MySQL Database using PHP.

Thanks in advance!

2 Answers

You could save the exel data as a CSV file thencheck out http://www.homeandlearn.co.uk/php/php10p6.html or google "read CSV file with php" for other solutions.

Thanks for your input!

Happy to help! I tried to find out how to do it in python for weeks before i found CSV format!

This post is a bit old, but since I came here from a Google search I thought I would add an answer. If you need to work with Excel using PHP, you can check out PHPOffice's PHPExcel.

If you are using Laravel, take a look at this Laravel-Excel package - I have used it successfully in a web app I am developing.