Jump to content

Importing of CSV files into database


genzedu777

Recommended Posts

Hi all,

 

I am currently facing an issue in importing CSV files into my database, due to the 'comma' issue

 

As you can see in picture1.jpg, I have the fields terminated by 'comma'.

 

The error happens in Picture2.jpg, as you can see through the red pointed arrow, No.5 'tutor_id' column became something else. It was due to No.2's tutor comment.

 

No.2 tutor's comment was written in such

"- 2 YEARS OF TEACHING EXP

- 2

- PRI MATHS AND SCIENCE

- BOTH ARE JUST GETTING PASSES IN THE SUBJECTS. AFTER 6 MONTHS, ONE GOT 75% AND THE OTHER 80%"

 

Basically "ONE GOT 75% AND THE OTHER 80%" appears in No.5 tutor's tutor_id, and the one which is highlighted in blue and nowhere to be seen in No.2 tutor's comment, it has been chopped off (see picture3.jpg)

 

Any idea how I should overcome this error? Should I set my 'fields terminated' as something else instead of the comma?

 

Please help!!

 

Thanks

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/222828-importing-of-csv-files-into-database/
Share on other sites

Hi,

 

Surprisingly, after trying it back home, it didn't work well again.

 

After placing an inverted comma in 'Fields enclosed by', and imported into the database, record 1, 2 and 10 appeared, but 3 - 9 were missing.

 

Picture2.jpg shows the appeared records and example1.doc shows the file which I am importing

 

May I know what is the possible reason that I have missing records?

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.