13.09.2016, 19:15
I know it's not pawn, and I know that will piss some of you off for whatever reason, I figure there's a better chance someone has done exactly what I'm trying to do in this forum....
Anyhow, I have a php script to find when the last login was of players, if it's more than 30 days, it prints out their properties to be removed later on. I don't really know of a more efficient way to do this, and this takes like five minutes to process through everything. The script does work exactly as I want it, besides the time delay.
Basically, it loops through all users and checks if their last login was more than 30 days ago, if it was, it loops through all the icons (1000 total) and lists any property owned by them
Anyhow, I have a php script to find when the last login was of players, if it's more than 30 days, it prints out their properties to be removed later on. I don't really know of a more efficient way to do this, and this takes like five minutes to process through everything. The script does work exactly as I want it, besides the time delay.
Basically, it loops through all users and checks if their last login was more than 30 days ago, if it was, it loops through all the icons (1000 total) and lists any property owned by them
PHP код:
<?php
$query = sprintf("SELECT * FROM `users` WHERE `lastlogin` + INTERVAL 30 DAY < NOW()");
$result = mysqli_query($con, $query);
if(mysqli_num_rows($result) != 0)
{
while($row = mysqli_fetch_array($result))
{
$uid = $row['ID'];
$name = $row['name'];
$lastlog = $row['lastlogin'];
$query57 = sprintf("SELECT * FROM `icons` WHERE `Type` = 10 AND `Owner` = '$name'");
$result57 = mysqli_query($con, $query57);
while($row57 = mysqli_fetch_array($result57))
{
$iid = $row57['ID'];
$address = $row57['Address'];
echo("[House ID: ".$iid."] [Address: ".$address."] [Owner: ".$name."] [Last Online: ".$lastlog."]<br>");
}
}
}
?>