Jump to content

Need Help


Recommended Posts

$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
Link to comment
Share on other sites

Something like this:

$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
Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock