Experimental project
This is a sandbox project, which contains experimental code for developer use only.
Overview
This module has been created to give a site admin's access to directly import a CSV file to a MySQL database table.
About
Currently the PDO layer for mysql does not have the drivers for running a query with 'LOAD DATA INFILE.'
This module takes advantage of mysqli_connect to perform this operation
Installation
- Install like a normal module
- You will need to update the Drupal database user's permissions to have FILE.
- E.g. GRANT FILE ON * . * TO 'username'@'localhost' IDENTIFIED BY 'password' ;
- Go to the configuration page and update with your table name and other CSV paramaters.
- Don't for get to set the permissions
Configuration Page
- admin/config/csv-importer
Notes
When inserting into the database the mysqli_connect use the default database
Credits
This is a port over from a class on phpclasses.org
Source: http://www.phpclasses.org/package/2917-PHP-Import-CSV-data-into-a-MySQL-...
Project information
- Module categories: Developer Tools
- Created by themic8 on , updated