刘68

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

<?php
class DBDA
{
public $host="localhost";
public $uid = "root";
public $pwd = "123";
public $dbname = "mydb";

//成员方法
public function Query($sql,$type=1)
{
$db = new MySQLi($this->host,$this->uid,$this->pwd,$this->dbname);
$r = $db->query($sql);

if($type==1)
{
return $r->fetch_all();
}
else
{
return $r;
}
}
}

posted on 2016-12-30 16:36  刘68  阅读(73)  评论(0编辑  收藏  举报