Jump to content

Recommended Posts

Hi guys I have a CSV File like below...

 

 

Birmingham," B1,B12,B37"

London," SW1,SW2"

 

I need to parse this with php to get it into a table postcode for each postcode and town,

 

example

 

Birmingham B1

Birmingham B12

Birmingham B37

London SW1

London SW2

 

Are there any good re usable php mysql cvs classes?

 

thanks for any help

 

 

Link to comment
https://forums.phpfreaks.com/topic/136196-csv-php-mysql/
Share on other sites

Hi guys

 

sorry was a little vague.

 

mysql table...

 

poscode,town,county,city.

 

csv file is in the order...

 

town, county,postcode,city.

 

And can be like this...

 

Aberdeen,Aberdeenshire,"AB1, AB2",Aberdeen,Scotland

"Aberlour, Turriff","Aberdeenshire, Banffshire, Kincardineshire",AB3,Aberdeen,Scotland

 

where a postcode can also cover mulitple towns.

 

TO be honest I am a little confused now, i need to think how best to store this in the db and use it, as a post code can have many towns, and a town many postcodes! I have a table of postcodes and lats and longs, and i wanted to add a column or reference table so i can also work out distance from a name by finding its postcode. Get me?

 

 

Link to comment
https://forums.phpfreaks.com/topic/136196-csv-php-mysql/#findComment-710461
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.