我正在尝试 OOP PHP,我似乎遇到了一些问题。
class Connection
{
public $con = false;
public $dbSelected = false;
public $activeConnection = null;
public $dataBaseName = "";
function __contruct($dbUserName, $dbPassword, $server = "localhost")
{
$this->con = mysql_connect($server,$dbUserName,$dbPassword);
if(!$this->con)
{
$this->activeConnection = false;
}
else
{
$this->activeConnection = true;
}
}
// Says the error is on the line bellow
public function dbConnect($dbName, $identifyer = $this->con)
{
$this->dbSelected = mysql_select_db($dbName, $identifyer);
$this->dataBaseName = $dbName;
if($this->dbSelected != true)
{
$this->connectionErrorReport();
}
}
//... Class continues on but is unimportant.
我收到 Parse 错误:第 21 行的 [path] 中出现意外的 T_VARIABLE 语法错误
我已经盯着它看了这么久,我真的需要一些帮助。