// Get Id, Streamanbieter und StreamId
$sql = mysql_query("SELECT `Id`,`Anbieter`,`StreamId`,`Online` FROM `streams`");
// Aktualisiere streams
while($row = mysql_fetch_object($sql)) {
$id = $row->Id;
$anbieter = $row->Anbieter;
$streamid = $row->StreamId;
$ison = $row->Online;
$set_online = "UPDATE streams Set Online = '1' WHERE Id = $id";
$set_offline = "UPDATE streams Set Online = '0' WHERE Id = $id";
//$set_onlinesince = "UPDATE streams SET Online_since = current_timestamp WHERE Id = $id AND Online_since = '0000-00-00 00:00:00'";
$viewers = get_viewers($streamid, $anbieter);
$update_viewers = "UPDATE streams Set Viewers = $viewers WHERE Id = $id";
$set_zero = "UPDATE streams Set Viewers = 0 WHERE Id = $id";
$set_datezero = "UPDATE streams Set Online_since = '0000-00-00 00:00:00' WHERE Id = $id";
if(get_online($streamid, $anbieter) == true) {
if($ison == 0) {
//mysql_query($set_onlinesince);
}
mysql_query($set_online);
mysql_query($update_viewers);
}
else {
mysql_query($set_offline);
mysql_query($set_zero);
mysql_query($set_datezero);
}
}
查看注释行 $set_onlinesince。我遇到了mysql_query($set_onlinesince)
几乎一直执行的问题,所以我制作了该IF
子句并在该子句中添加了一个附加语句Where
。它被执行了大部分时间。在那之后,我在条款中做出了回应IF
。当我执行文件时,它没有显示回显输出,但会执行mysql_query($set_onlinesince)
. 然后我试图推翻这条线,它仍然被执行。当我用查询对变量进行注释时,它仍然在页面重新加载后执行。这确实吓坏了我。我多次删除浏览器中的缓存,并在其他浏览器中尝试过。没有效果。怎么会这样???