-5
我做了一個網站,我加了點東西,當我去pm.php它給了我一個錯誤:PHP switch語句錯誤
Fatal error: Switch statements may only contain one default clause in /home/vol10_3/HIDDEN.com/HIDDEN/htdocs/includes/classes/pm.class.php on line 673
代碼:
function get_new_messages($uid=NULL,$type='pm')
{
if(!$uid)
$uid = userid();
global $db;
switch($type)
{
case 'pm':
default:
{
$count = $db->count(tbl($this->tbl),"message_id"," message_to LIKE '%#$uid#%' AND message_box='in' AND message_type='pm' AND message_status='unread'");
}
break;
case 'notification':
default:
{
$count = $db->count(tbl($this->tbl),"message_id"," message_to LIKE '%#$uid#%' AND message_box='in' AND message_type='notification' AND message_status='unread'");
}
break;
}
if($count>0)
return $count;
else
return "0";
}
}
就像錯誤狀態一樣。如果你還沒有http://php.net/manual/en/control-structures.switch.php –
我已經投票結束這個問題,因爲這個錯誤信息是完全自主的,解釋。 – EJoshuaS