封装访问数据库的类
1 host,$this->uid,$this->pwd,$db);15 //2.判断连接是否出错16 !mysqli_connect_error() or die("连接失败!");17 //3.执行SQL语句18 $result = $dbconnect->query($sql);19 20 if($type==0)21 {22 return $result->fetch_all();23 }24 else25 {26 return $result;27 }28 }29 }