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

I Nathan, not sure I follow what you are trying to do. I am thinking you may have to do a ‘Custom Query’.

You will need to use two MySQL commands … Group By and Count. If I understand correctly. You can Google those to find out the proper format if you aren’t familiar with them.

Maybe post a screenshot of your data structure as well and may help someone to point you in the right direction.

Welcome to Wappler!

I would consider it to be like a shopping cart without the cart. The customer would be the category and route would be the products. I need it to display all the products in the category and display how many products are in the inventory. I’ve seen some super complex cart tutorials, but nothing that really does what I want it to.

I would consider it to be like a shopping cart without the cart. The customer would be the category and route would be the products. I need it to display all the products in the category and display how many products are in the inventory. I’ve seen some super complex cart tutorials, but nothing that really does what I want it to.

Hi Nathan, this can be done with the Wappler. But not on the ‘Basic’ license. You will need the ‘Pro’ license to be able to access database related features/functions.

Can you point me to a tutorial or something to see how its done? I’ll upgrade if I can make this idea work.

Here is some Database Manager docs.

You will need an understanding how databases work though.