Class DbMysql

Description

Mysql数据库驱动类

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

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

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

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

Redefinition of:
Db::__construct()
架构函数
close (line 382)

关闭数据库

  • throws: ThinkExecption
  • access: public
void close ()
commit (line 188)

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

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

连接数据库方法

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

数据库错误信息

并显示当前的SQL语句

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

SQL指令安全过滤

  • throws: ThinkExecption
  • access: public
string escape_string (string $str)
  • string $str: SQL字符串
free (line 86)

释放查询结果

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

获得所有的查询数据

查询结果放到 resultSet 数组中

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

取得数据表的字段信息

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

获得一条查询结果

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

取得数据库的表信息

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

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

查询结果放到 result 数组中

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

事务回滚

  • throws: ThinkExecption
  • access: public
boolen rollback ()
startTrans (line 166)
  • access: public
void startTrans ()
_execute (line 143)

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

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

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

返回数据集

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

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:35 +0000 by 塞北的雪