PHP Class db_pdo, zys

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

Protected Properties

Свойство Type Description
$PDOStatement

Méthodes publiques

Méthode 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 启动事务

Méthodes protégées

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

Private Methods

Méthode Description
getAll ( ) : array 获得所有的查询数据

Method Details

__construct() public méthode

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

bindPdoParam() protected méthode

参数绑定
protected bindPdoParam ( $bind ) : void
Résultat void

close() public méthode

关闭数据库
public close ( )

commit() public méthode

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

connect() public méthode

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

error() public méthode

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

escapeString() public méthode

SQL指令安全过滤
public escapeString ( string $str ) : string
$str string SQL指令
Résultat string

execute() public méthode

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

free() public méthode

释放查询结果
public free ( )

getFields() public méthode

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

getLastInsertId() public méthode

获取最后插入id
public getLastInsertId ( ) : integer
Résultat integer

getTables() public méthode

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

parseKey() protected méthode

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

parseLimit() protected méthode

limit分析
protected parseLimit ( $limit ) : string
Résultat string

parseValue() protected méthode

value分析
protected parseValue ( mixed $value ) : string
$value mixed
Résultat string

query() public méthode

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

rollback() public méthode

事务回滚
public rollback ( ) : boolen
Résultat boolen

startTrans() public méthode

启动事务
public startTrans ( ) : void
Résultat void

Property Details

$PDOStatement protected_oe property

protected $PDOStatement