私は 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 error: syntax error, unexpected T_VARIABLE in [path] on line 21 が表示されます
私はそれを長い間見つめてきたので、本当に助けが必要です。