PHP Class DbPgSQL

Inheritance: extends DbBase, implements DbBaseInterface
Show file Open project: zblogcn/zblogphp

Public Properties

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

Public Methods

Method Description
Close ( ) 关闭数据库连接
CreateTable ( $table, array $datainfo ) 新建表
DelTable ( string $table ) 删除表
Delete ( string $query ) : resource 删除数据
EscapeString ( string $s ) : string 对字符串进行转义,在指定的字符前添加反斜杠,即执行addslashes函数
ExistTable ( string $table ) : boolean 判断数据表是否存在
Insert ( string $query ) : integer 插入数据
Open ( array $array ) : boolean 连接数据库
Query ( string $query ) : array 执行SQL查询语句
QueryMulit ( string $s ) 执行多行SQL语句
QueryMulti ( $s ) 错别字函数,历史原因保留下来
Update ( string $query ) : resource 更新数据
__construct ( ) 构造函数,实例化$sql参数

Method Details

Close() public method

关闭数据库连接
public Close ( )

CreateTable() public method

新建表
public CreateTable ( $table, array $datainfo )
$datainfo array 表结构

DelTable() public method

删除表
public DelTable ( string $table )
$table string 表名

Delete() public method

删除数据
public Delete ( string $query ) : resource
$query string SQL语句
return resource

EscapeString() public method

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

ExistTable() public method

判断数据表是否存在
public ExistTable ( string $table ) : boolean
$table string 表名
return boolean

Insert() public method

插入数据
public Insert ( string $query ) : integer
$query string SQL语句
return integer 返回ID序列号

Open() public method

连接数据库
public Open ( array $array ) : boolean
$array array 数据库连接配置 $array=array( 'pgsql_server', 'pgsql_username', 'pgsql_password', 'pgsql_name', 'pgsql_pre', 'pgsql_port', 'persistent') )
return boolean

Query() public method

执行SQL查询语句
public Query ( string $query ) : array
$query string
return array 返回数据数组

QueryMulit() public method

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

QueryMulti() public method

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

Update() public method

更新数据
public Update ( string $query ) : resource
$query string SQL语句
return resource

__construct() public method

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

Property Details

$dbname public property

数据库名
public $dbname

$dbpre public property

数据库名前缀
public $dbpre

$sql public property

DbSql实例
public $sql

$type public property

public $type

$version public property

public $version