<?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;
}
}
}