PHP Classes

Quick CSV import: Import CSV data into a MySQL database table

Recommend this page to a friend!
  Info   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 50%Total: 23,016 All time: 25 This week: 49Down
Version License PHP version Categories
quick_csv_import 1.0.0BSD License3PHP 5, Databases, Files and Folders
Description 

Author

This class can be used to import data from CSV (Comma Separated Value) files into a given MySQL database table.

It parses a given CSV file to extract the field names. Then it imports the data into the MySQL database using a LOAD DATA INFILE query to import the data in a much faster way than using SQL INSERT queries.

If necessary, the class can also create the database table using the CSV file headers to retrieve the table field names.

UPDATE: From now you can set the encoding table which is used to parse the file.

Picture of Alexander Skakunov
Name: Alexander Skakunov is available for providing paid consulting. Contact Alexander Skakunov .
Classes: 9 packages by
Country: Ukraine Ukraine
Age: 42
All time rank: 232 in Ukraine Ukraine
Week rank: 178 Down4 in Ukraine Ukraine Down
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Recommendations

Read huge Excel file
Read excel file of min 43MB and export values to MySQL

Import Excel CSV into MySQL table
I want to import CSV file to MySQL table

What is the best PHP class to extract recipients from CSV file?
I need to parse a .csv emails address list and send a message

Screenshots (1)  
  • csv.png
  Files folder image Files (4)  
File Role Description
Plain text file Quick_CSV_import.php Class Quick_CSV_import class
Accessible without login Plain text file Quick_CSV_import_example.php Example Class using example
Accessible without login Plain text file example.csv Data Example source of CSV file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:23,016
This week:0
All time:25
This week:49Down
User Ratings User Comments (8)
 All time
Utility:71%StarStarStarStar
Consistency:70%StarStarStarStar
Documentation:-
Examples:70%StarStarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2711