When I load data in from a file, I always make sure that the data is seperated
using a character which doesn't occur within the data itself - eg if you have
data with spaces in it, then don't use space a seperator.
eg
LOAD DATA LOCAL INFILE "countries.txt" INTO TABLE Countries FIELDS TERMINATED B
If you're unable to get to the bottom of this problem, you could probably
use PHP's trim() function to massage the data after the table's been
created. The basic algorithm would be to iterate through each record and
replace e.g. $country_name with trim ( $country_name ). Annoying to do, but
much