Import CSV File into MySQL Database

Image

Suppose there is a csv file named address.csv which contains name,email records we can export this data in to my sql with the statements

Here we are populating the content to Table Address with skipping very first row which contains labels

LOAD DATA INFILE address.csv’ INTO TABLE Address

FIELDS TERMINATED BY ‘,’

ENCLOSED BY ‘”‘

LINES TERMINATED BY ‘\r\n’

IGNORE 1 LINES;

Use phpMySQL to Execute this statement

The same statements can be called from PHP File connected to MySQL for easy content import

abhilash

abhilash, is a programmer by profession and a technology addict with a passion towards browsing , shopping and imaging . My views may be biased on reviews. all images and videos are copyrighted to respective owners.

1 comment

Your Header Sidebar area is currently empty. Hurry up and add some widgets.