PHP Class db_pdo, zys

Author: zqf PDO数据库驱动
Inheritance: extends db_Db
Datei anzeigen Open project: qieangel2013/zys Class Usage Examples

Protected Properties

Property Type Description
$PDOStatement

Public Methods

Method Description
__construct ( array $config = '' ) 架构函数 读取数据库配置信息
close ( ) 关闭数据库
commit ( ) : boolen 用于非自动提交状态下面的查询提交
connect ( $config = '', $linkNum ) 连接数据库方法
error ( ) : string 数据库错误信息 并显示当前的SQL语句
escapeString ( string $str ) : string SQL指令安全过滤
execute ( string $str, array $bind = [] ) : integer 执行语句
free ( ) 释放查询结果
getFields ( $tableName ) 取得数据表的字段信息
getLastInsertId ( ) : integer 获取最后插入id
getTables ( $dbName = '' ) 取得数据库的表信息
query ( string $str, array $bind = [] ) : mixed 执行查询 返回数据集
rollback ( ) : boolen 事务回滚
startTrans ( ) : void 启动事务

Protected Methods

Method Description
bindPdoParam ( $bind ) : void 参数绑定
parseKey ( string &$key ) : string 字段和表名处理
parseLimit ( $limit ) : string limit分析
parseValue ( mixed $value ) : string value分析

Private Methods

Method Description
getAll ( ) : array 获得所有的查询数据

Method Details

__construct() public method

架构函数 读取数据库配置信息
public __construct ( array $config = '' )
$config array 数据库配置数组

bindPdoParam() protected method

参数绑定
protected bindPdoParam ( $bind ) : void
return void

close() public method

关闭数据库
public close ( )

commit() public method

用于非自动提交状态下面的查询提交
public commit ( ) : boolen
return boolen

connect() public method

连接数据库方法
public connect ( $config = '', $linkNum )

error() public method

数据库错误信息 并显示当前的SQL语句
public error ( ) : string
return string

escapeString() public method

SQL指令安全过滤
public escapeString ( string $str ) : string
$str string SQL指令
return string

execute() public method

执行语句
public execute ( string $str, array $bind = [] ) : integer
$str string sql指令
$bind array 参数绑定
return integer

free() public method

释放查询结果
public free ( )

getFields() public method

取得数据表的字段信息
public getFields ( $tableName )

getLastInsertId() public method

获取最后插入id
public getLastInsertId ( ) : integer
return integer

getTables() public method

取得数据库的表信息
public getTables ( $dbName = '' )

parseKey() protected method

字段和表名处理
protected parseKey ( string &$key ) : string
$key string
return string

parseLimit() protected method

limit分析
protected parseLimit ( $limit ) : string
return string

parseValue() protected method

value分析
protected parseValue ( mixed $value ) : string
$value mixed
return string

query() public method

执行查询 返回数据集
public query ( string $str, array $bind = [] ) : mixed
$str string sql指令
$bind array 参数绑定
return mixed

rollback() public method

事务回滚
public rollback ( ) : boolen
return boolen

startTrans() public method

启动事务
public startTrans ( ) : void
return void

Property Details

$PDOStatement protected_oe property

protected $PDOStatement