-1
<?php
include $_SERVER['DOCUMENT_ROOT'].'/aaa/core/database/connect.php';
include $_SERVER['DOCUMENT_ROOT'].'/aaa/functions/general.php';
include $_SERVER['DOCUMENT_ROOT'].'/aaa/functions/users.php';
$sql = $conn->query("SELECT `user_id` FROM `users`") or die(mysqli_error($conn));
while ($row = $sql->fetch_assoc()) {
$user_id = $row['user_id'];
$inc_per_min = income_per_minute($user_id);
if ($inc_per_min > 0) {
$conn->query("UPDATE `game_data` SET `money_hand` = `money_hand` + '$inc_per_min' WHERE `user_id` = '$user_id'") or die(mysqli_error($conn));
}
}
?>
That’s the code I want to run every minute. This is what I have in charge of the cron:
Current Cron Jobs
Minuto Hora Dia Mês Dia útil Comando Ações
* * * * * /home/MyUserName/public_html/aaa/cron_stack.php
Can someone tell me why it doesn’t work?
It does not work because it is not calling the PHP executable to interpret the script.
– Bacco