Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query for array to jpgraph

Status
Not open for further replies.

PDT

Programmer
May 19, 2001
40
AU
Would appreciate help on this one, relatively new to PHP.

I have created a table in a MySQL Database with 2 columns, one with date (from a hidden form) and the other with a series of events selected from a drop down menu by user (eg. circus, theatre, cinema etc.).

Could someone help out with an example of PHP code to create an MySQL query that returns an array of dates (sorted into quarters ie. 3 monthly) with a count of the corresponding number of times each event was logged in that specific quarter.

The purpose would be to send this array to jpgraph to plot a line (or bar) graph of logged events over time selected by user, eg. 1-2 years.

Grateful for any assistance.


P
 
the query would be something like this:

SELECT event,date,quarter(date) as quarter from table order by quarter;

Really it depends on exactly how you want to view the results as to how the query to get them should be. ***************************************
Party on, dudes!
[cannon]
 
I was wanting to receive an array returned in a format such as - the number of each event per quarter (or month). Then to pass array to jpgraph_line to plot over time.
Variables plotted on y-axis (number of times recorded) vs. time x-axis (per quarter or month).

Thanks for your thoughts KarveR,


P
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top