Hello there, this is the first post I make and that I'm really new to PHP.
Alright, first of all I might tell you what I need help with.
You see, I own a bunch of game servers, where one of the servers sends Playername, SteamID and Playtime in minutes to a MySQL Database I have.
I have tried to set up a code that displays the data in the MySQL Database.
Here's what I have so far:
<html>
<head>
<title>Total Playtime</title>
</head>
<body>
<table>
<tr>
<td align="center">Total Playtime</td>
</tr>
<tr>
<td>
<table border="1">
<tr>
<td>Name</td>
<td>SteamID</td>
<td>Playtime<br>
<table border="1">
<tr>
<td>Weeks</td>
<td>Days</td>
<td>Hours</td>
<td>Minutes</td>
<td>Seconds</td></td></tr></table>
</tr>
<?
//the example of searching data
//with the sequence based on the field name
//search.php
mysql_connect("localhost","username","password");//database connection
mysql_select_db("database");
$order = "SELECT * FROM PlayInfo ORDER BY Playtime DESC";
//order to search data
//declare in the order variable
$result = mysql_query($order);
//order executes the result is saved
//in the variable of $result
while($data = mysql_fetch_row($result)){
echo("<tr><td>$data[1]</td><td>$data[0]</td><td>$data[2]</td></tr>");
}
?>
</table>
</td>
</tr>
</table>
</body>
</html>
This is how it looks like so far: http://bruteforcegaming.com/data.php
Playername is the name of the player.
SteamID is an ID Steam uses to recognize players.
Playtime is the total time spent on the server in minutes.
I need help with converting the Playtime to Weeks, Days, Hours and Minutes.
Any help is appreciated!
Best Regards.
Tom.