我收到语法错误,“意外”:'第38行',我无法弄明白:
public static function clearTasks($type){
$con = taskDB::connectDB();
switch ($type){
/* line 38: */
case: 'completed':
$type='=1';
break;
case: 'failed':
$type='=0';
break;
case: 'pending':
$type='is null';
break;
case: 'all':
$type='=1 or completed=0 or is null';
break;
}
$result = $con->query("DELETE FROM taskage WHERE completed".$type);
$con->close();
}
谁能告诉我为什么会这样?谢谢!
答案 0 :(得分:3)
:
case
case: 'completed':
应该是
case 'completed':