CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Real Tough Question!

Print topic Send  topic

Author Message
Ted
Posted: 07/09/2002, 3:10 PM

Ok here is the problem. I have a site I am building for a online business. I have created a database for customers. I give customers differnet status levels. I have created grids to view each different status level. I want to put a count next to the link for each grid. Something like such

MAIN MENU
New Signups (4)
Pending Signups (0)
To Be Completed (2)
Customers (123)

And so on. I have a table called customers. When A Customer signup it puts a "1" in the status field of the table. When they go to pending i change the "1" to a "2". and so on. So what I am looking to do is count the "1's" in the mysql and put the total next to the link in the main menu. I am doing this site in PHP with Mysql. Anyone have any good ideas of a simple but effective way of doing this?
Chris K.
Posted: 07/09/2002, 4:47 PM

You should build a grid with SQL query source (assuming you have cust_status[status_id,status_name] table). The query should be something similar:

SELECT status_name,count(status_id) as status_count FROM cust_status LEFT JOIN customers ON customer_status=status_id GROUP BY status_name

Now create a single column grid and put status_count label in () after status_name label.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.