Hallo,
ich habe ein Problem mit optionalen Parametern bei einer Funktion in einer Klasse:
Code:
class mySQL
{
var $link;
var $host;
var $user;
var $password;
var $database;
function connect($host = $this->host, $user = $this->user, $password = $this->password) // hier liegt das Problem
{
$this->link = mysql_connect($host, $user, $password);
if (!$this->link)
{
$this->error();
}
}
...
}
Wenn ich das so mache, gibt er mir diese Fehlermeldung aus:
Code:
Parse error: parse error, unexpected T_VARIABLE in /Library/WebServer/Documents/mySQL.php on line 13
Wie kann ich das umgehen? Danke schonmal für alle Antworten.
mfg RudiS