View Full Version : Data Base Management with myPHPadmin

08-28-2006, 06:42 PM
I am attempting to generate an Excel file (CSV) of products for my online store that I can then upload to my existing SQL database. As a starter to try to get a feel for SQL, I exported my existing data base with the "EXPORT" tab in phpMyadmin to an Excel (CSV) file on my desktop. Then, without making any changes I used the "IMPORT" tab to restore the database. The import process generated the following error:

"Invalid field count in CSV input on Line 1"

Obviously I am missing something. Is there a control record required as the first record in the Import????If so, what is the format?

Thank you,
Klaus Cook
Houston, Texas

09-13-2006, 10:04 PM
HI Klaus,

When I use to get that error from importing excel/csv files, it was because I didn't name each column, so instead of starting out with "firstname" at the top of each column to allow it to recognize as a first name to then import, I just had the first names. Not sure if it is the same with php, but I would get a very similar error when importing leads into
certain programs.


09-29-2007, 05:52 AM
Hi all i am newbie

i also got the same error but after doing some work i got solution. my .csv file look like excel file and i imported it successfully in MYSQL TABLE through phpmyadmin.

make sure you have done following step correctly

empty your table first if it has garbage

1. your cvs file's column name must match your table column name
2. browse your required .csv file
3. select CSV using LOAD DATA options
4. Check box 'ON' for Replace table data with file
5. in Fields terminated by box type ,
6. in Fields enclosed by box "
7. in Fields escaped by box \
8. in Lines terminated by box auto
9. in Column names box type column name seperated by , like column1,column2,column3
10 check box ON for Use LOCAL keyword.

i hope it will work for you