How To Import CSV File into MySQL using PHP

How To Import CSV File into MySQL using PHP

In this Post We Will Explain About is How To Import CSV File into MySQL using PHP With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to Import and Export CSV Files Using PHP and MySQL Example

In this post we will show you Best way to implement How to Import CSV File Data into MySQL Database using PHP, , hear for How To Import CSV File Into MySQL Using PHP with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

How to import CSV in PHP MySQL Example

fgetcsv() PHP method is used to All the read data from some CSV file. First of all make an any excel sheet and root path to save it as .csv format
Here We can download CSV File Demo.
Example to some data import CSV file and MySQL save to database.


File name to import :


if(isset($_POST['data_submit'])) {
		$err="please any select the file";
		$handle = fopen($_FILES['filename']['tmp_name'], "r");
		while (($Live_data = fgetcsv($handle, 1000, ",")) !== FALSE) {
			$import="INSERT into infomation
			(name,email,address,hobby,country,mobile,course) values('$Live_data[0]','$Live_data[1]','$Live_data[2]','$Live_data[3]','$Live_data[4]','$Live_data[5]','$Live_data[6]')";
	$err="Good Luck..!!1Import Done";


I hope you have Got What is How to Import CSV File Data Into Mysql Using PHP And how it works.I would Like to have FeadBack From My Blog( readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article( Are Most Always Welcome.

Leave a Comment