You'll find a lot of PHP scripts for importing of CSV files into MySql using PHP. However almost all of them requires you to make the table manually and create the table structures manually. The little piece of code below, originally coded by me, can automatically create table with all the required table structure and automatically import the csv file into mysql database. Well, the code is self explanatory. Every important line has comment so that u can understand the role of every line.