PHP Class SlightPHP\Db

显示文件 Open project: hetao29/slightphp

Public Properties

Property Type Description
$_globals array

Public Methods

Method Description
__construct ( $engineName = "mysql" )
delete ( string | array | object $table, string | array | object $condition ) : integer | boolean delete
error ( )
execute ( string $sql ) : boolean | integer | array
init ( array | object $params ) construct
insert ( string | array | object $table, string | array | object $item = "", boolean $isreplace = false, boolean $isdelayed = false, string | array | object $update = [] ) : integer | boolean insert
select ( string | array | object $table, string | array | object $condition = "", string | array | object $item = "", string | array | object $groupby = "", string | array | object $orderby = "", string | array | object $leftjoin = "" ) : DbData select data from db
selectOne ( $table, $condition = "", $item = "", $groupby = "", $orderby = "", $leftjoin = "" ) select one from select result
setCount ( $count ) is count
setLimit ( $limit ) page size
setPage ( $page ) page number
update ( string | array | object $table, string | array | object $condition, string | array | object $item ) : integer | boolean update data

Private Methods

Method Description
__addsqlslashes ( $k )
__array2string ( $mixed, $alais = false )
__query ( string $sql ) : Array query
__quote ( $condition, $split = "AND" )
__setEngine ( $engineName )

Method Details

__construct() public method

public __construct ( $engineName = "mysql" )

delete() public method

delete
public delete ( string | array | object $table, string | array | object $condition ) : integer | boolean
$table string | array | object
$condition string | array | object
return integer | boolean

error() public method

public error ( )

execute() public method

public execute ( string $sql ) : boolean | integer | array
$sql string
return boolean | integer | array

init() public method

construct
public init ( array | object $params )
$params array | object

insert() public method

insert
public insert ( string | array | object $table, string | array | object $item = "", boolean $isreplace = false, boolean $isdelayed = false, string | array | object $update = [] ) : integer | boolean
$table string | array | object
$item string | array | object
$isreplace boolean
$isdelayed boolean
$update string | array | object
return integer | boolean int(lastInsertId or affectedRows)

select() public method

select data from db
public select ( string | array | object $table, string | array | object $condition = "", string | array | object $item = "", string | array | object $groupby = "", string | array | object $orderby = "", string | array | object $leftjoin = "" ) : DbData
$table string | array | object
$condition string | array | object
$item string | array | object
$groupby string | array | object
$orderby string | array | object
$leftjoin string | array | object
return DbData object || Boolean false

selectOne() public method

select one from select result
public selectOne ( $table, $condition = "", $item = "", $groupby = "", $orderby = "", $leftjoin = "" )

setCount() public method

is count
public setCount ( $count )

setLimit() public method

page size
public setLimit ( $limit )

setPage() public method

page number
public setPage ( $page )

update() public method

update data
public update ( string | array | object $table, string | array | object $condition, string | array | object $item ) : integer | boolean
$table string | array | object
$condition string | array | object
$item string | array | object
return integer | boolean

Property Details

$_globals static_oe public_oe property

static public array $_globals
return array