0

I am quite new to pcharts and understand the mechanics. I nicely made a page where I show a single graph in my template by using the <img src='graph1.php'> logic.

I now have a pretty heavy query that provides me with the right data to create 4 charts. I only want to execute this query once (to minimize database load) and then have the four charts generated and loaded into my webpage. BTW. the query performance can not be improved, so that's no option.

I was thinking of query.php that generates 5 arrays (one for the common x-axis and 4 for each different graphs y-axis value).

But then I have no clue how I can pass these arrays on to the graph1.php, graph2.php, graph3.php and graph4.php files so the charts can be generated.

What is a smart way to do this? I'd rather not write (temporary) files to the server.

Thanks,

Geoffrey

Geoffrey Stoel
  • 1,300
  • 3
  • 14
  • 24

2 Answers2

0

Write the query result into the session and access it from the corresponding script. (Just make a check wether the data exists in the session and if not, execute the query just once)

Louis Huppenbauer
  • 3,719
  • 1
  • 18
  • 24
  • Thanks... Was thinking in that Same direction in the car on my way home :) was not sure if I could store arrays in session but that seems possible – Geoffrey Stoel Sep 07 '12 at 17:50
0

Strong suggestion: create a temporary table:

The table will only persist for as long as the session.

paulsm4
  • 114,292
  • 17
  • 138
  • 190