How to count a query result

How do you count and display the results in a multi query? I want to pull all the records for “customer” and group it by “route” Then I need it to count instances for each route and display the count. I will also need to take a database variable to subtract from the count to show remaining capacity. If remaining capacity for a route is “0”, the form will show an error when trying to submit the selection.

I’m still a newbie, so bare with me.
Example: http://phantomtranzit.com/ticket/index.php

Community Page
Last updated: