我不确定为什么这不像我想的那样工作.这是一个非常简单的循环,它从mysql dm中查找值.随时我插入我希望它执行的值.
我考虑过cron作业,但有时脚本需要更长的时间,所以我不会单独启动代码.
有谁知道如何解决这个问题?
<?php
a1:
set_time_limit(0);
include_once "mysql_con.php";
$result = mysql_query("SELECT * FROM requests WHERE status='pending' ORDER BY id DESC LIMIT 1");
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
sleep(10);
goto a1;
}
else
{
// CODE
goto a1;
}
?>
Run Code Online (Sandbox Code Playgroud)