fix: more crazy SQL calculations

This commit is contained in:
Martin Ambrus
2017-10-22 22:29:39 +02:00
parent ec9c5cdaa4
commit e19a039d28
3 changed files with 27 additions and 7 deletions
+7 -2
View File
@@ -42,8 +42,13 @@
<th>Players online</th>
<td><?php
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
echo $online; ?></td>
$online = mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (60*10))." AND tribe!=0 AND tribe!=4 AND tribe!=5");
if (!empty($online)) {
echo mysqli_fetch_assoc($online)['Total'];
} else {
echo 0;
}
?></td>
</tr>
</tbody>
</table>