这是部分代码<?php
class ConnDB{
private $localhost;
private $username;
private $pwd;
private $dbname;
private $coon;
private $code;
function _construct($localhost,$username,$pwd,$dbname,$coon, $code){
$this->localhost=$localhost;
$this->username=$username;
$this->pwd=$pwd;
$this->dbname=$dbname;
$this->code=$code;
}
function connect(){
$this->conn=mysqli_connect($this->localhost,$this->username, $this->pwd,$this->dbname)or die("Connect MySQL False");
mysqli_query($this->conn,"set names $this->code");
return $this->conn;
}
}