加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 无法为排行榜数据库设计提供合适的解决方案

发布时间:2020-12-13 22:51:02 所属栏目:PHP教程 来源:网络整理
导读:我为我的数据库提出了一个很好的设计非常麻烦,我已经尝试了两个不同的例子,但这些例子似乎都没有达到预期的效果. 这就是我所拥有的场景: 场景: A leaderboard consists out of multiple servers,a server has a name,a login address and a description. A
我为我的数据库提出了一个很好的设计非常麻烦,我已经尝试了两个不同的例子,但这些例子似乎都没有达到预期的效果.

这就是我所拥有的场景:

场景:

A leaderboard consists out of multiple servers,a server has a name,a
login address and a description. A player has a name and a unique ID.
Different actions of the player get recorded together with the date
when this action is performed
These are the actions a player can
perform:

  • He can make a kill
  • He can be killed ( a death )
  • His play time is recorded at the end of a match
  • He can win a game

Per action it’s date should be logged so i can get a list of his
statistics during the past week,past month,past year and overall.

我尝试的另一个解决方案是为每个表分别进行一次杀戮,例如
table_kills
table_deaths
table_wins
table_timeplayed
玩家

然而,我最终会有很多表,我不知道它是否很容易在代码中实现

更新:
添加最终结果(解决方案)

解决方法

根据您所描述的内容,我建议使用以下表格:

Servers (id,servername)
Players (id,playername,description,etc)
Actions (id,actionid,actionname,details)
PlayerActions (serverid,playerid,timestamp)
PlayerGameTime (id,serverid,timeplayed,timestamp)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读