PHP Class db_mysqli, zys

Inheritance: extends db
显示文件 Open project: qieangel2013/zys Class Usage Examples

Public Methods

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

Protected Methods

Method Description
parseKey ( string &$key ) : string 字段和表名处理添加`

Private Methods

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

Method Details

__construct() public method

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

close() public method

关闭数据库
public close ( ) : volid
return volid

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 ) : integer
$str string sql指令
return integer

free() public method

释放查询结果
public free ( )

getFields() public method

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

getTables() public method

取得数据表的字段信息
public getTables ( $dbName = '' ) : array
return array

insertAll() public method

插入记录
public insertAll ( mixed $datas, array $options = [], boolean $replace = false ) : false | integer
$datas mixed 数据
$options array 参数表达式
$replace boolean 是否replace
return false | integer | integer

parseKey() protected method

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

query() public method

执行查询 返回数据集
public query ( string $str ) : mixed
$str string sql指令
return mixed

replace() public method

替换记录
public replace ( mixed $data, array $options = [] ) : false | integer
$data mixed 数据
$options array 参数表达式
return false | integer | integer

rollback() public method

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

startTrans() public method

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