PHP代码如下:
if($duration!='' && $duration_in_hrs!='') {
$duration_in_sec = $duration_in_hrs * 60 * 60;
//echo $grid->mSqlArr['where']; die;
if(empty($grid->mSqlArr['where']) && $grid->mSqlArr['where']=='')
$grid->mSqlArr['where'] = " tests.test_duration = "."'"$duration"'"." ".$duration_in_sec;
else
$grid->mSqlArr['where'] .= " AND tests.test_duration "."'"$duration"'"." ".$duration_in_sec;
}
如果我从第 1 行注释代码。4 到 7 并回显变量的值,$grid->mSqlArr['where']
它正在打印输出 is_test_cancled='0' AND is_test_archive='0'
但是当我删除注释并运行代码时,出现空白屏幕,我无法理解这是如何发生的。我尝试调试,在此期间我收到以下错误
PHP Parse error: syntax error, unexpected T_VARIABLE in view_tests.php on line 218 Errors parsing view_tests.php
你能帮我解决这个错误吗?我没有得到价值后如何无法识别变量?提前致谢。