FLEA_Db_Driver_Mysql类参考

继承图,类FLEA_Db_Driver_Mysql

FLEA_Db_Driver_Abstract FLEA_Db_Driver_Mysqlt

所有成员的列表。

公有成员

 connect ($dsn=false)
 close ()
 selectDb ($database)
 execute ($sql, $inputarr=null, $throw=true)
 qstr ($value)
 qtable ($tableName, $schema=null)
 qfield ($fieldName, $tableName=null, $schema=null)
 _insertId ()
 _affectedRows ()
 fetchRow ($res)
 fetchAssoc ($res)
 freeRes ($res)
 selectLimit ($sql, $length=null, $offset=null)
 metaColumns ($table)
 metaTables ($pattern=null, $schema=null)

公有属性

 $NEXT_ID_SQL = 'UPDATE %s SET id = LAST_INSERT_ID(id + 1)'
 $CREATE_SEQ_SQL = 'CREATE TABLE %s (id INT NOT NULL)'
 $INIT_SEQ_SQL = 'INSERT INTO %s VALUES (%s)'
 $DROP_SEQ_SQL = 'DROP TABLE %s'
 $META_COLUMNS_SQL = 'SHOW FULL COLUMNS FROM %s'
 $PARAM_STYLE = DBO_PARAM_QM
 $HAS_INSERT_ID = true
 $HAS_AFFECTED_ROWS = true
 $_mysqlVersion = null


详细描述

在文件Mysql.php31行定义。


成员函数文档

FLEA_Db_Driver_Mysql::connect ( dsn = false  ) 

连接数据库

参数:
array $dsn
返回:
boolean

重载FLEA_Db_Driver_Abstract

FLEA_Db_Driver_Mysqlt重载。

在文件Mysql.php43行定义。

参考 FLEA_Db_Driver_Abstract::$dsn__THROW()execute()FLEA::getAppInf()FLEA_Db_Driver_Abstract::getOne()FLEA::loadClass()selectDb().

FLEA_Db_Driver_Mysql::close (  ) 

关闭数据库连接

重载FLEA_Db_Driver_Abstract

在文件Mysql.php89行定义。

FLEA_Db_Driver_Mysql::selectDb ( database  ) 

选择要操作的数据库

参数:
string $database
返回:
boolean

重载FLEA_Db_Driver_Abstract

在文件Mysql.php95行定义。

参考 __THROW()FLEA::loadClass().

参考自 connect().

FLEA_Db_Driver_Mysql::execute ( sql,
inputarr = null,
throw = true 
)

执行一个查询,返回一个 resource 或者 boolean 值

参数:
string $sql
array $inputarr
boolean $throw 指示查询出错时是否抛出异常
返回:
resource|boolean

重载FLEA_Db_Driver_Abstract

在文件Mysql.php104行定义。

参考 __THROW()FLEA_Db_Driver_Abstract::bind()FLEA::loadClass()log_message().

参考自 FLEA_Db_Driver_Mysqlt::_completeTrans()FLEA_Db_Driver_Mysqlt::_startTrans()connect()metaColumns()metaTables()selectLimit().

FLEA_Db_Driver_Mysql::qstr ( value  ) 

转义字符串

参数:
string $value
返回:
mixed

重载FLEA_Db_Driver_Abstract

在文件Mysql.php131行定义。

参考自 metaTables().

FLEA_Db_Driver_Mysql::qtable ( tableName,
schema = null 
)

将数据表名字转换为完全限定名

参数:
string $tableName
string $schema
返回:
string

重载FLEA_Db_Driver_Abstract

在文件Mysql.php139行定义。

参考自 qfield().

FLEA_Db_Driver_Mysql::qfield ( fieldName,
tableName = null,
schema = null 
)

将字段名转换为完全限定名,避免因为字段名和数据库关键词相同导致的错误

参数:
string $fieldName
string $tableName
string $schema
返回:
string

重载FLEA_Db_Driver_Abstract

在文件Mysql.php144行定义。

参考 qtable().

FLEA_Db_Driver_Mysql::_insertId (  ) 

在文件Mysql.php150行定义。

FLEA_Db_Driver_Mysql::_affectedRows (  ) 

在文件Mysql.php155行定义。

FLEA_Db_Driver_Mysql::fetchRow ( res  ) 

从记录集中返回一行数据

参数:
resouce $res
返回:
array

重载FLEA_Db_Driver_Abstract

在文件Mysql.php160行定义。

参考自 metaTables().

FLEA_Db_Driver_Mysql::fetchAssoc ( res  ) 

从记录集中返回一行数据,字段名作为键名

参数:
resouce $res
返回:
array

重载FLEA_Db_Driver_Abstract

在文件Mysql.php165行定义。

FLEA_Db_Driver_Mysql::freeRes ( res  ) 

释放查询句柄

参数:
resource $res
返回:
boolean

重载FLEA_Db_Driver_Abstract

在文件Mysql.php170行定义。

参考自 metaTables().

FLEA_Db_Driver_Mysql::selectLimit ( sql,
length = null,
offset = null 
)

进行限定记录集的查询

参数:
string $sql
int $length
int $offset
返回:
resource

重载FLEA_Db_Driver_Abstract

在文件Mysql.php175行定义。

参考 execute().

FLEA_Db_Driver_Mysql::metaColumns ( table  ) 

返回指定表(或者视图)的元数据

部分代码参考 ADOdb 实现。

每个字段包含下列属性:

name: 字段名 scale: 小数位数 type: 字段类型 simpleType: 简单字段类型(与数据库无关) maxLength: 最大长度 notNull: 是否不允许保存 NULL 值 primaryKey: 是否是主键 autoIncrement: 是否是自动增量字段 binary: 是否是二进制数据 unsigned: 是否是无符号数值 hasDefault: 是否有默认值 defaultValue: 默认值

参数:
string $table
返回:
array

重载FLEA_Db_Driver_Abstract

在文件Mysql.php190行定义。

参考 execute()FLEA_Db_Driver_Abstract::setValueByType().

FLEA_Db_Driver_Mysql::metaTables ( pattern = null,
schema = null 
)

获得所有数据表的名称

参数:
string $pattern
string $schema
返回:
array

重载FLEA_Db_Driver_Abstract

在文件Mysql.php304行定义。

参考 execute()fetchRow()freeRes()qstr().


成员数据文档

FLEA_Db_Driver_Mysql::$NEXT_ID_SQL = 'UPDATE %s SET id = LAST_INSERT_ID(id + 1)'

用于 genSeq()、dropSeq() 和 nextId() 的 SQL 查询语句

重载FLEA_Db_Driver_Abstract

在文件Mysql.php33行定义。

FLEA_Db_Driver_Mysql::$CREATE_SEQ_SQL = 'CREATE TABLE %s (id INT NOT NULL)'

重载FLEA_Db_Driver_Abstract

在文件Mysql.php34行定义。

FLEA_Db_Driver_Mysql::$INIT_SEQ_SQL = 'INSERT INTO %s VALUES (%s)'

重载FLEA_Db_Driver_Abstract

在文件Mysql.php35行定义。

FLEA_Db_Driver_Mysql::$DROP_SEQ_SQL = 'DROP TABLE %s'

重载FLEA_Db_Driver_Abstract

在文件Mysql.php36行定义。

FLEA_Db_Driver_Mysql::$META_COLUMNS_SQL = 'SHOW FULL COLUMNS FROM %s'

用于获取元数据的 SQL 查询语句

重载FLEA_Db_Driver_Abstract

在文件Mysql.php37行定义。

FLEA_Db_Driver_Mysql::$PARAM_STYLE = DBO_PARAM_QM

重载FLEA_Db_Driver_Abstract

在文件Mysql.php38行定义。

FLEA_Db_Driver_Mysql::$HAS_INSERT_ID = true

重载FLEA_Db_Driver_Abstract

在文件Mysql.php39行定义。

FLEA_Db_Driver_Mysql::$HAS_AFFECTED_ROWS = true

重载FLEA_Db_Driver_Abstract

在文件Mysql.php40行定义。

FLEA_Db_Driver_Mysql::$_mysqlVersion = null

在文件Mysql.php41行定义。


该类的文档由以下文件生成:
Generated at Sat Feb 2 15:18:54 2008 for FleaPHP by  doxygen 1.5.3