Class DbPdo

Description

PDO数据库驱动类

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

Base
   |
   --Db
      |
      --DbPdo
Variable Summary
Method Summary
DbPdo __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 = ''])
ArrayObject _query ([string $str = ''])
Variables
Methods
Constructor __construct (line 37)

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

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

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

关闭数据库

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

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

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

连接数据库方法

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

数据库错误信息

并显示当前的SQL语句

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

SQL指令安全过滤

  • throws: ThinkExecption
  • access: public
string escape_string (string $str)
  • string $str: SQL指令
free (line 86)

释放查询结果

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

获得所有的查询数据

查询结果放到 resultSet 数组中

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

取得数据表的字段信息

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

获得一条查询结果

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

取得数据库的表信息

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

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

查询结果放到 result 数组中

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

事务回滚

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

启动事务

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

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

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

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

返回数据集

  • throws: ThinkExecption
  • access: protected
ArrayObject _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:38 +0000 by 塞北的雪