PHP Class DbMySQLi

Inheritance: implements iDataBase
Datei anzeigen Open project: zblogcn/zblogphp Class Usage Examples

Public Properties

Property Type Description
$dbengine 数据库引擎
$dbname 数据库名
$dbpre 数据库名前缀
$sql DbSql实例
$type
$version

Public Methods

Method Description
Close ( ) 关闭数据库连接
CreateDB ( string $dbmysql_server, string $dbmysql_port, string $dbmysql_username, string $dbmysql_password, string $dbmysql_name ) : boolean 创建数据库
CreateTable ( $table, $datainfo, $engine = null )
DelTable ( $table )
Delete ( $query ) : boolean | mysqli_result
EscapeString ( string $s ) : string 对字符串进行转义,在指定的字符前添加反斜杠,即执行addslashes函数
ExistTable ( $table ) : boolean
Insert ( $query ) : integer | string
Open ( array $array ) : boolean 连接数据库
Query ( $query ) : array
QueryMulit ( string $s ) : array 执行多行SQL语句
QueryMulti ( $s ) 错别字函数,历史原因保留下来
Update ( $query ) : boolean | mysqli_result
__construct ( ) 构造函数,实例化$sql参数

Method Details

Close() public method

关闭数据库连接
public Close ( )

CreateDB() public method

创建数据库
public CreateDB ( string $dbmysql_server, string $dbmysql_port, string $dbmysql_username, string $dbmysql_password, string $dbmysql_name ) : boolean
$dbmysql_server string
$dbmysql_port string
$dbmysql_username string
$dbmysql_password string
$dbmysql_name string
return boolean

CreateTable() public method

public CreateTable ( $table, $datainfo, $engine = null )
$table
$datainfo

DelTable() public method

public DelTable ( $table )
$table

Delete() public method

public Delete ( $query ) : boolean | mysqli_result
$query
return boolean | mysqli_result

EscapeString() public method

对字符串进行转义,在指定的字符前添加反斜杠,即执行addslashes函数
public EscapeString ( string $s ) : string
$s string
return string

ExistTable() public method

public ExistTable ( $table ) : boolean
$table
return boolean

Insert() public method

public Insert ( $query ) : integer | string
$query
return integer | string

Open() public method

连接数据库
public Open ( array $array ) : boolean
$array array 数据库连接配置 $array=array( 'dbmysql_server', 'dbmysql_username', 'dbmysql_password', 'dbmysql_name', 'dbmysql_pre', 'dbmysql_port', 'persistent' 'engine')
return boolean

Query() public method

public Query ( $query ) : array
$query
return array

QueryMulit() public method

执行多行SQL语句
public QueryMulit ( string $s ) : array
$s string 以;号分隔的多条SQL语句
return array

QueryMulti() public method

错别字函数,历史原因保留下来
public QueryMulti ( $s )

Update() public method

public Update ( $query ) : boolean | mysqli_result
$query
return boolean | mysqli_result

__construct() public method

构造函数,实例化$sql参数
public __construct ( )

Property Details

$dbengine public_oe property

数据库引擎
public $dbengine

$dbname public_oe property

数据库名
public $dbname

$dbpre public_oe property

数据库名前缀
public $dbpre

$sql public_oe property

DbSql实例
public $sql

$type public_oe property

public $type

$version public_oe property

public $version