I am trying to import data in SQL from CSV into PHP My Admin, so this may be a problem with PHP My Admin. The problem is that some of the columns use special characters, for example:
"Adan, Antonio"
Ends as "Ad".
The column structure is as follows:
CREATE TABLE IF NOT EXISTS `players` (
`player_name` varchar (255) COLLATE utf8 NOT NULL,
`player_nation` varchar (255) CHARACTER SET utf8 NOT NULL,
`player_club` varchar (255) CHARACTER SET utf8 NOT NULL,
`player_position` varchar (255) CHARACTER SET utf8 NOT NULL,
`player_age` tinyint (2) NOT NULL,
`player_dob` varchar (32) CHARACTER SET utf8 NOT NULL,
`player_based` varchar (255) CHARACTER SET utf8 NOT NULL,
`player_id` int (10) unsigned NOT NULL
) ENGINE = MyISAM DEFAULT CHARSET = utf8 COLLATE = utf8;
I assume this has something to do with the character set, but mysql.com just suggests changing the table to the utf8 character set that it already has.
Any ideas how else I can prevent this?
UPDATE
The insert into the database is fine, so I assume that it is not related to my table structure. This seems to be especially important for importing from CSV.
This is a request for download data generated by PHP My Admin
LOAD DATA LOCAL INFILE 'C: \\ Windows \\ Temp \\ php21E4.tmp' INTO TABLE `players` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\ r \ n'.
Decision
. CSV . , , UTF8, . SQL.