• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

Importing CSV into phpMyAdmin not working

I am trying to import a CSV into phpMyAdmin, but am having issues.  I have done some Google searching to find out how to do it yet each time the values tried to go into the id field and the name field is empty.  Any help is greatly appreciated.
INSERT INTO `department_school` VALUES ('School of Law', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('School of Medicine', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('Goizueta Business School', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('Rollins School of Public Health', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('School of Medicine', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('School of Law', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('Anthropology, Emory College', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('English, Emory College', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('Nell Hodgson Woodruff School of Nursing', '')# Affected rows: 1
INSERT INTO `department_school` VALUES ('ILA, Graduate School of the Arts and Sciences', '')# Affected rows: 1

Open in new window

Screen-shot-2010-01-01-at-4.46.5.png
0
pingeyeg
Asked:
pingeyeg
  • 4
  • 2
1 Solution
 
pingeyegAuthor Commented:
The table layout is:

table: faculty
fields: id, name
0
 
mstrelanCommented:
It looks like it thinks there is a blank field after each value. Also I am assuming that id is an auto_increment field.

Try removing the trailing comma after each value and try again. Easiest way is to string replace ", with just "
0
 
mstrelanCommented:
actually if it was an auto_increment field it wouldn't allow your text values in to the field... make sure the field is an INT with the auto_increment property
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
pingeyegAuthor Commented:
The id is set to auto_increment and the type is set to INT(11)
0
 
pingeyegAuthor Commented:
Any suggestions?
0
 
pingeyegAuthor Commented:
Yeah, each time I try to import, I get the error and only numbers show.  The name field staffs empty.
0
 
kumaranmcaCommented:
Greetings pingeyeg,

Please find attached my CSV import data code with this comment. Kindly change db connection property and table details also. I think its helpful for you....


Connect.php
import.php
test.csv
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now