Hi
With the code snippet given in the following post
http://www.daniweb.com/web-development/php/threads/126361/csv-file-uploading-into-a-mysql-database
I am able to import csv data into phpmyadmin. However, I am getting an error if csv data contains a text with apostrophe (‘) symbol (e.g. my book’s name is abc).
Appriciate any suggestions to resolve this error.
Thank you.
nikki05
0
Newbie Poster
Recommended Answers
Jump to PostLikely to be a problem with SQL rather than reading the csv.
You may need to use mysql_real_escape_string() on data items - you could use array_map for this. I'm assuming you have a variation on the following:while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.