Spieler in 24 h ?

08/31/2014 13:18 9TAILS#1
Hallo,

ich wollte fragen ob ich das hier richtig geschrieben habe:

PHP Code:
$result2 mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 24 HOURS) < last_play"));


echo 
'<tr style="height:20px;line-height:20px;"><td>Spieler in 24h: </td><td>'.$result2['count'].'</td>'
also ob man : HOURS,HOUR,hours,hour,H,h schreiben muss.

Lg Tom Jessel
08/31/2014 13:23 'oShet#2
teste es doch aus?
[Only registered and activated users can see links. Click Here To Register...]

mfg
08/31/2014 17:24 9TAILS#3
Hab noch paar Fragen also bin noch bissel verwirt...

PHP Code:
<?php

$result1 
mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 1 SECOND) < last_play"));


echo 
'<tr style="height:20px;line-height:20px;"><td>Spieler online: </td><td>'.$result1['count'].'</td>';

?>
</center></font>

<div class=sb-tren></div>

<center>
<?php

$result2 
mysql_fetch_assoc(mysql_query("SELECT COUNT(id) AS count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 24 HOUR) < last_play"));


echo 
'<tr style="height:20px;line-height:20px;"><td>Spieler in 24h: </td><td>'.$result2['count'].'</td>';
so das ist einmal player online und einmal player in 24h.
em muss ich das jetzt immer ohne ein S Schreiben oder mit ...?
08/31/2014 21:09 .Shōgun#4
No you can't count players with a mysql query. The second query is allright.
09/01/2014 00:30 Mashkin#5
Quote:
Originally Posted by .Shōgun View Post
No you can't count players with a mysql query. The second query is allright.
You can approximately count the currently active players (players active last X minutes, where X should be around 5-15 minutes).
09/01/2014 00:39 Coniesan#6
Die sekunden-Abfrage wird meines Erachtens jedoch nicht ganz functionieren, da bei unveränderten Files die Aktuallisierungsintervalle zwischen 8 und 10min liegen! Es wird beim last-play nicht jede Sekunde der Wert aktuallisiert weswegen die Anzeige großteils "0" Spieler einzeigen würde...!