12-25造数据库面向对象

<?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 @ 2016-12-27 10:14  F4ntasy  阅读(79)  评论(0)    收藏  举报

對不起,您的瀏覽器不支持Flash


請使用支持Flash的瀏覽器訪問本頁,謝謝!