I find code on this forum and I go use it.
$sql2 = "SELECT TIME_TO_SEC(TIMEDIFF(NOW(), time)) FROM database WHERE id = 1";
$result = $conn->query($sql2);
if ($result >= 86400) {
$sql5 = "UPDATE points SET value = 1 WHERE id = 1";
$result = $conn->query($sql5);
$sql6 = "UPDATE points SET time = NOW() WHERE id = 1";
$result = $conn->query($sql6);
}
Here is my code.
It doesn´t change after 24 hours.
SQL - time:
2017-07-16 11:10:06
It saves time.
And it doesn´t work.
So thank you guys for help.
I have this now:
$sql2 = "SELECT TIME_TO_SEC(TIMEDIFF(NOW(), `dailytime`)) FROM `points` WHERE steamid = '".$steamprofile['steamid']."'";
$result = $conn->query($sql2);
if ($result >= 86400) {
$sql5 = "UPDATE points SET daily = 1 WHERE steamid = '".$steamprofile['steamid']."'";
$result = $conn->query($sql5);
$sql6 = "UPDATE points SET `dailytime` = NOW() WHERE steamid = '".$steamprofile['steamid']."'";
$result = $conn->query($sql6);
}