我收到一个语法错误,“第 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();
}
谁能告诉我为什么会这样?谢谢!