I have a PHP file that checks if a field in MySQL database is empty.
If the field is empty, PHP is an update.
I want to color this file in the background on Linux.
If a user creates a record, the PHP file in the background will be updated.
My PHP code:
$mysqli = mysqli_connect("localhost","name","pass","database");
$query = 'UPDATE users SET permissions = "content" WHERE permissions = ""';
$n = $mysqli->query($query);
$query = "SELECT * from users";
$result = $mysqli->query($query);
$row = $result->fetch_array(MYSQLI_ASSOC);
$subdominio = $row["name"];
$created_at = $row["created_at"];
Ubuntu & Debian:
apt-get -y install screen
CentOS & Fedora:
yum -y install screen
**** Follow steps 3 & 4 to execute myfile.php all the time. And follow steps 5 & 6 to execute myfile.php every 1 minute or every X time using crontab. ****
php myfile.php ' .
And minimize/hide it by pressing
Ctrl + A + D.
And get back to it by typing '
screen -r ' .
crontab -e ' .
* * * * * php myfile.php' ... If you don't want every minute, Google about crontab.