di solito io faccio così:
Codice PHP:
class Uno {
protected $host;
protected $user;
protected $pass;
protected $database;
function __construct() {
$this->host = "localhost";
$this->user = "user";
$this->$pass = "password";
$this->$database = "database";
}
}
class Due extends Uno {
function __construct() {
parent::__construct();
}
public function Salva() {
$link = mysql_connect($this->host, $this->user, $this->pass);
$db = mysql_db_select($this->$database);
// ecc ecc
}
}
utilitzzo semrpe le stesse variabili senza perdere tempo a ridefinirle per ogni classe