<?php

define(
'BASE_PATH',
'/var/www/html/easychair'
);

require
BASE_PATH
.
'/vendor/autoload.php';

require
BASE_PATH
.
'/app/core/Database.php';

use App\Core\Database;

$db=
Database::getInstance();

$stmt=
$db
->query("

SELECT *

FROM
conference_home_commands

WHERE status='queued'

LIMIT 20

");

foreach(
$stmt
as $cmd
){

$db
->prepare("

UPDATE
conference_home_commands

SET

status='done'

WHERE id=?

")

->execute([

$cmd[
'id'
]

]);

echo
$cmd[
'command_name'
]
.
PHP_EOL;

}
