PHP Class DbSql

Datei anzeigen Open project: zblogcn/zblogphp Class Usage Examples

Public Methods

Method Description
Count ( string $table, string $count, string $where = null, null $option = null ) : string 构造计数语句
CreateTable ( string $table, array $datainfo, $engine = null ) : string 创建表,返回构造完整的SQL语句
DelTable ( string $table ) : string 删除表,返回SQL语句
Delete ( string $table, string $where, array | null $option = null ) : string 构造数据删除语句
ExistTable ( string $table, string $dbname = '' ) : string 检查表是否存在,返回SQL语句
Export ( $table, $keyvalue, $type = 'mysql' )
Filter ( $sql ) : mixed 返回经过过滤的SQL语句
Insert ( string $table, string $keyvalue ) : string 构造数据插入语句
ReplacePre ( &$s ) : string 替换数据表前缀
Select ( string $table, string $select = null, string $where = null, string $order = null, string $limit = null, array | null $option = null ) : string 构造查询语句
Update ( string $table, string $keyvalue, string $where, array | null $option = null ) : string 构造数据更新语句
__construct ( &$db = null )
get ( )

Method Details

Count() public method

构造计数语句
public Count ( string $table, string $count, string $where = null, null $option = null ) : string
$table string
$count string
$where string
$option null
return string 返回构造的语句

CreateTable() public method

创建表,返回构造完整的SQL语句
public CreateTable ( string $table, array $datainfo, $engine = null ) : string
$table string
$datainfo array
return string

DelTable() public method

删除表,返回SQL语句
public DelTable ( string $table ) : string
$table string
return string

Delete() public method

构造数据删除语句
public Delete ( string $table, string $where, array | null $option = null ) : string
$table string
$where string
$option array | null
return string 返回构造的语句

ExistTable() public method

检查表是否存在,返回SQL语句
public ExistTable ( string $table, string $dbname = '' ) : string
$table string
$dbname string
return string

Export() public method

public Export ( $table, $keyvalue, $type = 'mysql' )

Filter() public method

返回经过过滤的SQL语句
public Filter ( $sql ) : mixed
$sql
return mixed

Insert() public method

构造数据插入语句
public Insert ( string $table, string $keyvalue ) : string
$table string
$keyvalue string
return string 返回构造的语句

ReplacePre() public method

替换数据表前缀
public ReplacePre ( &$s ) : string
return string

Select() public method

构造查询语句
public Select ( string $table, string $select = null, string $where = null, string $order = null, string $limit = null, array | null $option = null ) : string
$table string
$select string
$where string
$order string
$limit string
$option array | null
return string 返回构造的语句

Update() public method

构造数据更新语句
public Update ( string $table, string $keyvalue, string $where, array | null $option = null ) : string
$table string
$keyvalue string
$where string
$option array | null
return string 返回构造的语句

__construct() public method

public __construct ( &$db = null )

get() public method

public get ( )