douju7245 2013-03-04 10:12
浏览 129

如何自定义导出查询结果(PHP mysql)到excel文件?

I have some questions about customizing export result(excel) with php. The idea is i want to export my query of my raw data (mysql table) to excel file but with some customization in the result. for example i want to have result which is summary of the table like below table: enter image description here

The 3rd column until 7th column is named based on the last 5 days of my report date.

My idea is: 1. create temporary table using format as the result table i want to generate 2. Insert the table with my raw data. 3. Delete those table.

Is that efective?or is there any better idea?

  • 写回答

2条回答 默认 最新

  • duanjing7298 2013-03-04 10:15
    关注

    You can always use a view. Which is essentially a select statement with your data in there, and which will be updated whenever your tables are updated. Then you can just do a 'select * from view_name' and export that into your excel.

    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大