Forum Moderators: coopster
$CountLocations = "select count (Location) as Location from Scores where Flag='A'";
$CountLocations2 = mysql_query($CountLocations);
$CountLocations3 = mysql_result($CountLocations2, 0, "Location");
Thx in advance
select count(distinct Location) as Location from Scores where Flag='A' should work, although i think using count and distinct together requires a newish version of mysql.
If that doesn't work, you could use:
select Location, count(Location) as loc_num from Scores where Flag='A' group by Location then count the number of rows returned.
arran.