You have to remember a few things to successfully import .csv files in the database from phpmyadmin. Save your Excel file as a csv file. Please Do not save it as a workbook or any other format, check it with a text reader such as notepad or similar. You can see that each column is separated by a comma (,). This is required when we import the file with PHPmyAdmin. Please remove column headings, blank areas and ensure that there is an entry of some form in each row and column. The data in the table should represent identically in the CSV file. If your table has ‘n’ columns you must have ‘n’ columns in the CSV file as well.
load data local infile ‘Full path for .CSV file’ into table city
fields terminated by ‘,’
enclosed by ‘”‘
lines terminated by ‘\n’
Replace actual full path with “Full path for .CSV file” (/home/username/public_html/filename.csv)
Powered by BetterDocs
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.