Author Topic: importing csv file in phpmyadmin  (Read 370 times)

0 Members and 1 Guest are viewing this topic.

Offline sudhakararaogTopic starter

  • Irregular
  • Posts: 40
    • View Profile
importing csv file in phpmyadmin
« on: February 20, 2010, 06:20:28 AM »
i would like to import a csv file into the database so that i do not have to manually make entries when using a cms


initially i selected the database and then the table into which i want to add new data and exported as csv file and then added deleted all the entries in this file and added 1 new entry following the format in the csv file that i exported

when i import this csv file i keep getting the error

Invalid field count in CSV input on line 1.

while importing the csv file i have changed Fields terminated by from ; to ,

what is the correct procedure so that i dont get this error

also when exporting as csv file should i select the Put fields names in the first row option and there are other options as well, how should i go about so that i dont get the error when importing


also if i select the sql option and then delete the entries and make a new entry and if i import this file i get the error
#1062 - Duplicate entry '1' for key 'PRIMARY'

before importing i have selected the database and selected the table into which i want to import the csv or sql file

also before importing the files i suppose i have to make sure that the file i import is the same name as the table whether i import a csv or sql file

please advice how to go about for csv and sql format

also i guess the procedure for csv format can be followed for an
Microsoft Excell 2000 and CSV for MS Excel i guess

Offline fenway

  • MySQL Si-Fu / PHP Resident Alien
  • Global Moderator
  • 'Mind Boggling!'
  • *
  • Posts: 15,443
  • Gender: Male
    • View Profile
Re: importing csv file in phpmyadmin
« Reply #1 on: February 23, 2010, 01:00:01 PM »
Hard to say, having seen none of the actual input.
:anim_rules: Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.