OK I am really getting confused over here. I did this before but with the contract i signed I couldn't keep the source. I don't remember how I did this either. Someone on here helped me and it was a while back. Here is my code:
<?php
include("connection.inc");
$sql = "SELECT DISTINCT city FROM clients ORDER BY city";
$result = mysql_query($sql);
if (mysql_num_rows($result) < 1) {
print("<b><i>I am sorry there are no matches for that state.</b></i>");
}else{
while ($row = mysql_fetch_array($result)) {
printf("<option value='%s'>%s</option>",$row['city'],$row['city']);
}
}
?>
I have a field that is named cat. Now the deal is that they put in their state and it uses the above code to tell all the cities we have currently for that state. Now I want it to tell me how many cats we have filled under that city.
Example:
Columbus has 4 category's filled
Galena has 6 category's filled
Lancaster has 2 category's filled
I want it to say just:
Columbus (4)
Galena (6)
Lancaster (2)
How can I get the totals? I know how to get the city names... now how do I get the totals? I would appreicate ANY help in this. I don't care if its the smallest thing. Anything will be great!
Chad