【发布时间】:2017-12-14 13:16:58
【问题描述】:
当计数器超过 5 时,我需要调用脚本函数 open(),但是当我加载我的网页时,它显示了一个致命错误:超过 30 秒的最大执行时间。这是我的while循环问题吗?
$result = mysqli_query($dbconnect, "SELECT id, temp, hum, lum FROM weather ORDER BY id DESC LIMIT 5");
while($row = mysqli_fetch_assoc($result)){
$weather["temp"] = $row["temp"];
$weather["lum"] = $row["lum"];
$tempcounter = 0;
while ($weather["temp"] > 27) {
$tempcounter++;
}
if($tempcounter > 5){
echo"<script>open()</script>";
}}
【问题讨论】:
-
你错过了一个结束
},不要认为这是问题,只是指出可能有更多我们在这里看不到的代码, -
你想做什么不清楚
标签: php while-loop execution-time