ricez Posted June 3, 2008 Share Posted June 3, 2008 Hey everyone, I am trying to add this file into a MySQL table and it is not working out as predicted. I want to have the database field to be: ZIP, LATITUDE, LONGITUDE, CITY, STATE, COUNTY, ZIP_CLASS Here are the first few lines from the text file: "00501","+40.922326","-072.637078","HOLTSVILLE","NY","SUFFOLK","UNIQUE" "00544","+40.922326","-072.637078","HOLTSVILLE","NY","SUFFOLK","UNIQUE" "00601","+18.165273","-066.722583","ADJUNTAS","PR","ADJUNTAS","STANDARD" "00602","+18.393103","-067.180953","AGUADA","PR","AGUADA","STANDARD" "00603","+18.455913","-067.145780","AGUADILLA","PR","AGUADILLA","STANDARD" "00604","+18.493520","-067.135883","AGUADILLA","PR","AGUADILLA","STANDARD" "00605","+18.465162","-067.141486","AGUADILLA","PR","AGUADILLA","STANDARD" "00606","+18.172947","-066.944111","MARICAO","PR","MARICAO","STANDARD" I tried using this and it didn't fan out as predicted with the use of PHPMyAdmin. Any help with this is appreciated. Link to comment https://forums.phpfreaks.com/topic/108489-creating-a-table-with-this-csv-data/ Share on other sites More sharing options...
hvle Posted June 3, 2008 Share Posted June 3, 2008 you need to write a script, this script read each row, parse the csv into single field then insert into database. Sound complicated but could easily be written in PHP. Link to comment https://forums.phpfreaks.com/topic/108489-creating-a-table-with-this-csv-data/#findComment-556280 Share on other sites More sharing options...
ricez Posted June 3, 2008 Author Share Posted June 3, 2008 Cool. Thank you. By the way, what is wrong with PHPMYAdmin when it comes to importing csv? Link to comment https://forums.phpfreaks.com/topic/108489-creating-a-table-with-this-csv-data/#findComment-556571 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.