我在页面上运行此查询以使用 foreach 语句显示表中的记录。我认为它导致页面加载缓慢。我在想第二行可能是导致问题的原因。但是,如果我删除该行WHERE code = 'FE'
,页面会抛出一个 foreach 错误Warning: Invalid argument supplied for foreach()
$arrquery = "SELECT * FROM phpvms_schedules
WHERE code = 'FE'
AND locate(dayofweek(convert_tz(now(),'+1:00','+0:00'))-1,".TABLE_PREFIX."schedules.daysofweek)>0
AND phpvms_schedules.enabled = '1'
ORDER BY arrtime ASC";
$arrlist = DB::get_results($arrquery);
前锋:
foreach($arrlist as $flight)