Jump to content

Recommended Posts

Posted (edited)

$time=time() + 24*60*60;

 

$active=@mysql_numrows(mysql_query("SELECT * FROM characters WHERE lastAccess<$time",$link));

 

dont work i dont know why, iwant to add how many player logged in in 24 hours show in my website

please help

Edited by dievas
Posted (edited)

Something like this:

<?php
$con = mysqli_connect("localhost","root","","l2jdb") or die("Error " . mysqli_error($con));

$date = date(strtotime("-1 day"));

$query = "SELECT char_name, lastAccess FROM characters WHERE lastAccess / 1000 > $date ORDER BY char_name" or die("Something went wrong.." . mysqli_error($con));

$result = $con->query($query);

while($row = mysqli_fetch_array($result)) {
    echo $row["char_name"] . " - " . date("d/m/Y H:i:s", $row["lastAccess"] / 1000) . "<br>";
}
?>
Edited by Tessa
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..