doujiu3095 2012-09-07 16:25
浏览 64
已采纳

如何让一个数据库查询使用pchart库创建两个图表?

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

  • 写回答

2条回答 默认 最新

  • dongyan2267 2012-09-07 16:31
    关注

    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)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 软件供应链安全是跟可靠性有关还是跟安全性有关?
  • ¥15 电脑蓝屏logfilessrtsrttrail问题
  • ¥20 关于wordpress建站遇到的问题!(语言-php)(相关搜索:云服务器)
  • ¥15 【求职】怎么找到一个周围人素质都很高不会欺负他人,并且未来月薪能够达到一万以上(技术岗)的工作?希望可以收到写有具体,可靠,已经实践过了的路径的回答?
  • ¥15 Java+vue部署版本反编译
  • ¥100 对反编译和ai熟悉的开发者。
  • ¥15 带序列特征的多输出预测模型
  • ¥15 Python 如何安装 distutils模块
  • ¥15 关于#网络#的问题:网络是从楼上引一根网线下来,接了2台傻瓜交换机,也更换了ip还是不行
  • ¥15 资源泄露软件闪退怎么解决?