Class DbMysqli

Description

Mysqli数据库驱动类

Located in /Think/Db/Driver/DbMysqli.class.php (line 24)

Base
   |
   --Db
      |
      --DbMysqli
Method Summary
static void close ()
static string error ()
static string escape_string (string $str)
DbMysqli __construct ([array $config = ''])
boolen commit ()
void connect ([ $config = ''], [ $linkNum = 0])
void free ()
array getAll ([ $sql = null], [string $resultType = null])
void getFields ( $tableName)
array getRow ([ $sql = null], [index $seek = 0], string $str)
void getTables ([ $dbName = ''])
boolen next ()
boolen rollback ()
void startTrans ()
integer _execute ([string $str = ''])
ArrayObject _query ([ $str = ''], string $sqlStr)
Variables
Methods
static close (line 403)

关闭数据库

  • throws: ThinkExecption
  • access: public
static void close ()
static error (line 425)

数据库错误信息

并显示当前的SQL语句

  • throws: ThinkExecption
  • access: public
static string error ()
static escape_string (line 447)

SQL指令安全过滤

  • throws: ThinkExecption
  • access: public
static string escape_string (string $str)
  • string $str: SQL指令
Constructor __construct (line 35)

架构函数 读取数据库配置信息

  • access: public
DbMysqli __construct ([array $config = ''])
  • array $config: 数据库配置数组

Redefinition of:
Db::__construct()
架构函数
commit (line 205)

用于非自动提交状态下面的查询提交

  • throws: ThinkExecption
  • access: public
boolen commit ()
connect (line 53)

连接数据库方法

  • throws: ThinkExecption
  • access: public
void connect ([ $config = ''], [ $linkNum = 0])
  • $config
  • $linkNum
free (line 91)

释放查询结果

  • access: public
void free ()
getAll (line 322)

获得所有的查询数据

查询结果放到 resultSet 数组中

  • throws: ThinkExecption
  • access: public
array getAll ([ $sql = null], [string $resultType = null])
  • string $resultType: 数据集类型
  • $sql
getFields (line 353)

取得数据表的字段信息

  • throws: ThinkExecption
  • access: public
void getFields ( $tableName)
  • $tableName
getRow (line 286)

获得一条查询结果

  • throws: ThinkExecption
  • access: public
array getRow ([ $sql = null], [index $seek = 0], string $str)
  • index $seek: 指针位置
  • string $str: SQL指令
  • $sql
getTables (line 382)

取得数据表的字段信息

  • throws: ThinkExecption
  • access: public
void getTables ([ $dbName = ''])
  • $dbName
next (line 255)

获得下一条查询结果 简易数据集获取方法

查询结果放到 result 数组中

  • throws: ThinkExecption
  • access: public
boolen next ()
rollback (line 230)

事务回滚

  • throws: ThinkExecption
  • access: public
boolen rollback ()
startTrans (line 184)

启动事务

  • throws: ThinkExecption
  • access: public
void startTrans ()
_execute (line 149)

执行语句 针对 INSERT, UPDATE 以及DELETE

  • throws: ThinkExecption
  • access: protected
integer _execute ([string $str = ''])
  • string $str: sql指令
_query (line 110)

执行查询 主要针对 SELECT, SHOW 等指令

返回数据集

  • throws: ThinkExecption
  • access: protected
ArrayObject _query ([ $str = ''], string $sqlStr)
  • string $sqlStr: sql指令
  • $str

Inherited Methods

Inherited From Db

Db::__construct()
Db::add()
Db::addAll()
Db::addConnect()
Db::addSpecialChar()
Db::autoExec()
Db::debug()
Db::execute()
Db::factory()
Db::fieldFormat()
Db::find()
Db::getDbType()
Db::getInstance()
Db::getLastSql()
Db::initConnect()
Db::isMainIps()
Db::lazyQuery()
Db::multiConnect()
Db::parseDSN()
Db::parseFields()
Db::parseGroup()
Db::parseHaving()
Db::parseJoin()
Db::parseLimit()
Db::parseOrder()
Db::parseSets()
Db::parseTables()
Db::parseValues()
Db::parseWhere()
Db::Q()
Db::query()
Db::remove()
Db::save()
Db::setDec()
Db::setField()
Db::setInc()
Db::setLockMode()
Db::switchConnect()
Db::W()

Documentation generated on Thu, 27 Mar 2008 08:20:36 +0000 by 塞北的雪