This topic is locked

Graph of towns...

4/19/2007 5:46:16 AM
PHPRunner General questions
M
mmponline author

I might be asking something that will be covered in the help menus when new version is available, but this is my need:
I need a graph of 4 towns. The graph must show the amount of entries of a specific town in that field.
Eg.

TownA - 40

TownB - 20

TownC - 50

TownD - 10
It seems like the graphs only reads integers (not the town name itself) so I'm not sure how to to this. Should there be a different table tat counts the town name in that field and write it in. If so, what query would do this trick.
Maybe something like: select from tableA where town=TownA (and then the sum ot that name somehow)

kujox 4/19/2007

try here and see if this helps
Mysql Sum

Sergey Kornilov admin 4/19/2007

Stephan,
something like this will work:

SELECT Town, Count(Town) FROM TableName GROUP BY Town
W
wildwally 6/1/2007

now comes the silly question. where do you insert this code?
I really do like the PHPrunner program, however I find it dificult to mix or customize it to my needs. For instance the graphs, I thought this was my answer and had my boss purchase the program. now I finding it difficult to because 3 pages are generated per page.

Sergey Kornilov admin 6/1/2007

wildwally,
this code is meant to be inserted into SQL query tab in PHPRunner.
If you have any problems doing this contact support team directly at support@xlinesoft.com providing more info.

W
wildwally 6/2/2007

Ok, I was able to get things to work half way. This has just broaden my horizon, thanks I never really had an inderstanding of this before.
But here is my new problem. So far I am able to get the results of one count. How do I get this?
Region--------Store_Type-----Total

CENTRAL-----New Store--------#

EAST----------New Store--------#

WEST---------New Store--------#

CENTRAL-----Remodel---------#

EAST----------Remodel---------#

WEST---------Remodel--------#

CENTRAL-----OTHER-----------#

EAST---------OTHER-----------#

WEST---------OTHER-----------#
Right now I have this:
Region------Store_Type----Total

CENTRAL----New Store------ #

EAST------ New Store ----- #

WEST------New Store ----- #
with this code:
SELECT `Region`, `Store_Type`, COUNT(Store_Type) FROM _complete_request WHERE Store_Type = "New Store" OR Store_Type = "Remodel" GROUP BY Region

W
wildwally 6/3/2007

I might be able to figure this out if somebody can tell me how to join statements, I have tried the UNION but this does not seem to work.