views:

512

answers:

2

I need an import tools for a web app. I've been looking around and found some, just not sure about their stability. I'm using the Zend Framework for part of the project and was hoping I could find an import tool there, since I already have the framework, but couldn't see one...am I looking in the wrong place?

I would like the web users to be able to import csv, excel files into a mysql database. I'd like the tool to allow the users to select the columns of the spreadsheet/csv to match up to the database columns if possible. For the exporting side I'm leaning to using jasper reports to export a dataset to csv,excel...is this a good/bad idea?

Are there some tools free or commercial tools that you have used and would recommend, to allow me to incorporate this feature into my website?

Thanks.

+1  A: 

For import:
Try MySql's built-in csv import: LOAD DATA INFILE

LOAD DATA INFILE 'yourdata.csv' INTO TABLE tbl_name
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n';

For export:
Try the jQuery plugin: table2csv. It converts an HTML table into a CSV file. Use the argument, delivery:'value', to return the csv as a string.

Here's an example implementation. I know it's in C#, but there's only a little code involved. It would be easy to port to PHP.

Bill Paetzke
Wow, that guy should make a table2XML plug-in.
Dr. Zim
awsome. thanks!
Ronedog
A: 

worth a look: dbTube

nice looking PHP application to import Excel into mySQL. You can create a mapping (excel column => mysql column) with a graphical AJAX editor

Timo Hellhagen