I have a field called region in my MySQL database.
The 3 possible entries in this field are North, South or Central
I would like a single select statement that returns how many records are found with each entry.
For instance, if there are 5 records with a region of North, 3 with a region of South, and 1 with a region of central.
I would like MySQL to return 3 fields, named north, south, central with the numbers, 5, 3, and 1 respectively.
i tried to do it myself, but I dont know how to count multiple entries in a single field.
Example:
The following statement will find the amount of records that have North as the region, but I want to also get 2 more fields named south and central that also return the correct results.
$sql = "SELECT count(region) AS north FROM mytable WHERE region = 'North'";
Thanks for the help...