I have a database of zipcodes in this format:
zip varchar(11)
state char(2)
latitude varchar(10)
longitude varchar(10)
city varchar(50)
full_state varchar(50)
is_active tinyint(1)
I am importing a csv file into it. Everything loads fine
except for the state(2) field which instead of loading say, MA or NY, it
just loads it as one character, M and N. I am using a mysql myisam table and
using the PHPAdmin import feature. Any ideas on the possibilities causing this?
If you need more info let me know and thanks in advance!
Check to ensure that your csv file doesn’t have spaces around the state field. For example, it should be like this:
Cincinnati,OH,45241,USAand not
Cincinnati, OH, 45241, USAIf you could paste a few lines of your file it would help diagnose the problem.