[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Importing CSV into phpMyAdmin not working

Posted on 2010-01-01
7
Medium Priority
?
244 Views
Last Modified: 2013-12-12
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
Comment
Question by:pingeyeg
  • 4
  • 2
7 Comments
 
LVL 1

Author Comment

by:pingeyeg
ID: 26159213
The table layout is:

table: faculty
fields: id, name
0
 
LVL 10

Expert Comment

by:mstrelan
ID: 26159227
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
 
LVL 10

Expert Comment

by:mstrelan
ID: 26159233
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 1

Author Comment

by:pingeyeg
ID: 26159317
The id is set to auto_increment and the type is set to INT(11)
0
 
LVL 1

Author Comment

by:pingeyeg
ID: 26161511
Any suggestions?
0
 
LVL 1

Author Comment

by:pingeyeg
ID: 26161522
Yeah, each time I try to import, I get the error and only numbers show.  The name field staffs empty.
0
 
LVL 8

Accepted Solution

by:
kumaranmca earned 2000 total points
ID: 26183494
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month20 days, 11 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question