$this
->res =
$res
;
}
}
public
function
exec
(
$sql
){
$res
=
$this
->pdo->
exec
(
$sql
);
if
(
$res
){
$this
->res =
$res
;
}
}
public
function
fetchAll(){
return
$this
->res->fetchAll();
}
public
function
fetch(){
return
$this
->res->fetch();
}
public
function
fetchColumn(){
return
$this
->res->fetchColumn();
}
public
function
lastInsertId(){
return
$this
->res->lastInsertId();
}
/**
* 参数说明
* int $debug 是否开启调试,开启则输出 sql 语句
* 0 不开启
* 1 开启
* 2 开启并终止程序
* int $mode 返回类型
* 0 返回多条记录
* 1 返回单条记录
* 2 返回行数
* string/array $table 数据库表,两种传值模式
* 普通模式:
* 'tb_member, tb_money'
* 数组模式:
* array('tb_member', 'tb_money')
* string/array $fields 需要查询的数据库字段,允许为空,默认为查找全部,两种传值模式
* 普通模式:
* 'username, password'
* 数组模式:
* array('username', 'password')
* string/array $sqlwhere 查询条件,允许为空,两种传值模式
* 普通模式: