标签:show 语句 local his sqli cal utf8 query nbsp
class conn11
{
var $host = ‘‘;
var $user = ‘‘;
var $pass = ‘‘;
var $db = ‘‘;
var $point= ‘‘;
//构造方法
function __construct($host,$user,$pass,$db,$point="3306")
{
$this->host=$host;
$this->user=$user;
$this->pass=$pass;
$this->db=$db;
$this->point=$point;
}
function con(){
$connect = mysqli_connect($this->host,$this->user,$this->pass,$this->db,$this->point);
return $connect;
}
//连接数据库
function connect(){
if(mysqli_query($this->con(),"set names utf8")){
return true;
}
else{
return false;
}
}
//执行SQL语句
function sel ($sql){
$res = mysqli_query($this->con(),$sql);
return $res;
}
//遍历
function fetch($a){
return mysqli_fetch_assoc($a);
}
标签:show 语句 local his sqli cal utf8 query nbsp
原文地址:https://www.cnblogs.com/index0629/p/9050168.html