I want to read data from single .CSV files using php & mysql How to store it into Mysql multiple tables
single .csv file how to store the multiple tables using php
Collapse
X
-
Use str_getcsv if you are using PHP 5.3 and above or fgetcsv if using older version to read the CSV.
For the mysql part there's lots of tutorials on how to do it. Just make sure that you write a more generic DAO layer than you can reuse.
Also consider loading the data directly into the database using MySQL's own LOAD DATE command:http://dev.mysql.com/doc/refman/5.1/en/load-data.html
Comment