我嘗試父功能,但我得到這個錯誤:意想不到的 '靜態'(T_STATIC),預計標識符(T_STRING)
unexpected 'static' (T_STATIC), expecting identifier (T_STRING)
我有PHP v5.4.7 這裏是代碼
public function static tableExist($table, $db)
{
$tables = mysql_exists($db);
while(list($temp) = mysql_fetch_array($name, $pass))
{
if($temp = $table)
{
return TRUE;
}
else
{
return FALSE;
}
}
}
和使用
if(register::tableExist(users, webshop));
{
echo "succes";
}
'公共靜態函數' – Mike
您可能希望參考[OOP上的PHP手冊](http://php.net/language.oop5)以瞭解將來的語法問題。 – Charles
我刪除了OOP標籤,因爲當你開始使用'static'時,它實際上不是OOP。僅僅因爲你正在使用類,並不會使它成爲OOP。 – PeeHaa