class db{
private $host;
private $user;
private $pwd;
private $db;
public function __construct($host,$user,$pwd,$db){
$this->connect($host,$user,$pwd,$db);
}
public function connect($host,$user,$pwd,$db){
//....
}
}
------解决方案-------------------- 正解,要 有个构造函数