简体   繁体   English

按日期在单独的表中显示mySQL数据(使用PHP)

[英]Displaying mySQL data in separate tables by date (Using PHP)

Working on a small little project for a group of friends. 正在为一群朋友做一个小小的项目。

Essentially, sport stats are saved into a database and then pulled out and displayed in a table. 本质上,运动统计信息保存到数据库中,然后拉出并显示在表格中。

Currently it looks like this: 当前看起来像这样:

Name1 Stat1 Stat2 Stat3 6/15/2015
Name1 Stat1 Stat2 Stat3 6/12/2015
Name1 Stat1 Stat2 Stat3 6/12/2015
Name1 Stat1 Stat2 Stat3 6/12/2015
Name1 Stat1 Stat2 Stat3 6/12/2015
Name1 Stat1 Stat2 Stat3 6/9/2015
Name1 Stat1 Stat2 Stat3 6/7/2015

So, all the information is pulled and displays in a single table organized by the date. 因此,所有信息都被提取并显示在按日期组织的单个表中。 Instead of displaying every single row in one table, I would like to display a separate table for each date. 我不想在一个表中显示每一行,而是想为每个日期显示一个单独的表。

So we would have 4 separate tables instead of just the one large one. 因此,我们将有4个单独的表,而不仅仅是一个大表。

Name1 Stat1 Stat2 Stat3 6/15/2015

Name1 Stat1 Stat2 Stat3 6/12/2015
Name1 Stat1 Stat2 Stat3 6/12/2015
Name1 Stat1 Stat2 Stat3 6/12/2015
Name1 Stat1 Stat2 Stat3 6/12/2015

Name1 Stat1 Stat2 Stat3 6/9/2015

Name1 Stat1 Stat2 Stat3 6/7/2015

I've been struggling with how to do this for a few weeks now, I dont have much time to put into this and my PHP knowledge is limited. 我已经为如何做到这一点而苦苦挣扎了几个星期,我没有太多时间来讨论这个问题,而且我的PHP知识也很有限。 Can anyone point me in the right direction? 谁能指出我正确的方向?

Thank you! 谢谢!

Each time that mysql finds a new date insert </table> a <br> and then a new <table> statement 每次mysql找到新的日期时,先插入</table> ,然后先输入<br> ,然后再输入新的<table>语句

I recomend you to use css styles . 我建议您使用css styles

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM