server = $server;
$this->username = $username;
$this->password = $password;
$this->default_db = $default_db;
// 连接数据库
$this->link = mysql_connect($this->server,$this->username,$this->password);
if (!$this->link) {
echo 'database connect failure!';
}
// 设置默认的数据库
$bool = mysql_select_db($this->default_db,$this->link);
if (!$bool) {
echo 'Select default_db failure!';
}
}
// 声明析构函数
public function __destruct() {
mysql_close($this->link);
}
}
已抢141426个
抢已抢4834个
抢已抢7617个
抢已抢22235个
抢