C
C
crack_user2021-03-23 17:11:26
PHP
crack_user, 2021-03-23 17:11:26

How to solve cron job problem?

Greetings, I decided to create a game timer for the VK bot, but I ran into the problem that the cron does not work, the script itself works, but only with any activity from the user. (i.e. the script sends a message only after pressing the button, but I need the script to work with the help of cron and the cron can already send the message itself, without any intervention)
I connect cron via - cron-job.org
The site itself says that cron is running and running every minute.
6059f66147142780274188.png
6059f6d436a60264065409.png

$results = mysqli_query($link,"SELECT * FROM user WHERE time_game != 0"); 
    while($row = mysqli_fetch_array($results)) 
    {;
        if(time() >= $row['time_game']){
            $querys = mysqli_query($link,"UPDATE user SET `time_game`= '0' WHERE user_id = '".$user_id."'");
            $kbd=[
                'one_time'=> false,
                'buttons'=> [
                    [getbtn('Профиль','primary','Профиль')],
                    [getbtn('Помощь','secondary','Помощь')],
                ] 
            ];
            message($row['user_id'],'end',$kbd);
            die('OK');
        }
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question