25.05.2014, 21:26
Only useful if you're going to take advantage of its structure and functionalities. Sorting, grouping, counting, ...
However, this requires that you know how to properly design the database. A player's data will be scattered around different tables and additionally an individual player may have multiple rows assigned to them, depending on what's being stored. For example, I have this structure for a table that logs all individual sessions:

Which allows me to run this query:
Which then conveniently returns:
However, this requires that you know how to properly design the database. A player's data will be scattered around different tables and additionally an individual player may have multiple rows assigned to them, depending on what's being stored. For example, I have this structure for a table that logs all individual sessions:

Which allows me to run this query:
PHP код:
select userid, SEC_TO_TIME(SUM(time_logoff - time_logon)) AS time_played FROM player_ip_list WHERE userid = 1 GROUP BY userid, ip, pci
userid | time_played | |
1 | 06:34:25 |