0

我收到一个语法错误,“第 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();  
}

谁能告诉我为什么会这样?谢谢!

4

1 回答 1

3

没有:case

case: 'completed':

应该

case 'completed':
于 2013-02-15T02:08:56.610 回答