PHP and Excel

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

PHP and Excel

Post by thiscatis »

Is there a way to create a PHP script so you can export data from excel into a mysql database,
or is there a better solution, maybe directly export data from excel into a db?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

There's a couple of methods. The first, and arguably easiest, is to export the data from Excel as CSV or TSV data and import that using phpMyAdmin or SQLYog or something.

Alternatively you can connect to an Excel file using PHP's ODBC functions. It's not a great interface though.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

If i remember well it should be possible to install the mysql-odbc driver.. And then do the import from within excel directly... (No php needed)
Post Reply