Jump to content

PHP MySQL and Unique Records


andyd34

Recommended Posts

Sorry I was a bit vague in my question.

 

I want to return a list like this

 


echo $place['country'] . ', '.$place['county'].',  '. $place['city'].' ('.substr($place['p_code'], 0, -3).')';

 

which would return

 

United Kindom, Greater London, Walford (E17)

United Kingdom, Lancashire, Wigan (WN1)

United Kingdom, Lancashire, Standish (WN4)

United Kingdom, Merseyside Liverpool (L1)

United Kingdom, Cheshire, Ellesmere Port {L63)

and so on

 

the are several recurrences of some city fields and I have to full post code for each street/road in the cities.

 

Hope this explains things a little more but thanks for you reply

SELECT DISTINCT country,county,city FROM Table

 

This will extract only on row for each count of Country Count and City

 

SELECT DISTINCT country,county,city,p_code FROM Table

 

May not be what you are wanting, will look and see if the full post code has been extracted before and return it if it hasn't

 

Hope this is more helpful

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.