\ADODB_informix72

Connection object. For connecting to databases, and executing queries.

Summary

Methods
Properties
Constants
Version()
ServerInfo()
IsConnected()
_findvers()
outp()
Time()
Connect()
_nconnect()
NConnect()
PConnect()
outp_throw()
_CreateCache()
SQLDate()
Prepare()
PrepareSP()
Quote()
QMagic()
q()
ErrorNative()
nextId()
RowLock()
CommitLock()
RollbackLock()
SetFetchMode()
Query()
LimitQuery()
Disconnect()
Param()
InParameter()
OutParameter()
Parameter()
IgnoreErrors()
StartTrans()
CompleteTrans()
FailTrans()
HasFailedTrans()
Execute()
adodb_strip_count_keyword()
_Execute()
CreateSequence()
DropSequence()
GenID()
Insert_ID()
PO_Insert_ID()
Affected_Rows()
ErrorMsg()
ErrorNo()
MetaError()
MetaErrorMsg()
MetaPrimaryKeys()
MetaForeignKeys()
SelectDB()
SelectLimit()
SerializableRS()
_rs2rs()
GetAll()
GetAssoc()
CacheGetAssoc()
GetOne()
GetMedian()
CacheGetOne()
GetCol()
CacheGetCol()
Transpose()
OffsetDate()
GetArray()
CacheGetAll()
CacheGetArray()
GetRandRow()
GetRow()
CacheGetRow()
Replace()
CacheSelectLimit()
CacheFlush()
_gencachename()
CacheExecute()
AutoExecute()
GetUpdateSQL()
GetInsertSQL()
UpdateBlob()
UpdateBlobFile()
BlobDecode()
BlobEncode()
SetCharSet()
IfNull()
LogSQL()
GetCharSet()
UpdateClob()
MetaType()
SetDateLocale()
GetActiveRecordsClass()
GetActiveRecords()
Close()
BeginTrans()
SetTransactionMode()
MetaTransaction()
CommitTrans()
RollbackTrans()
MetaDatabases()
MetaProcedures()
MetaTables()
_findschema()
MetaColumns()
MetaIndexes()
MetaColumnNames()
Concat()
DBDate()
BindDate()
BindTimeStamp()
DBTimeStamp()
UnixDate()
UnixTimeStamp()
UserDate()
UserTimeStamp()
escape()
addq()
qstr()
PageExecute()
CachePageExecute()
ADODB_informix72()
_insertid()
_affectedrows()
xMetaColumns()
_connect()
_pconnect()
_query()
_close()
$dataProvider
$databaseType
$database
$host
$user
$password
$debug
$maxblobsize
$concat_operator
$substr
$length
$random
$upperCase
$fmtDate
$fmtTimeStamp
$true
$false
$replaceQuote
$nameQuote
$charSet
$metaDatabasesSQL
$metaTablesSQL
$uniqueOrderBy
$emptyDate
$emptyTimeStamp
$lastInsID
$hasInsertID
$hasAffectedRows
$hasTop
$hasLimit
$readOnly
$hasMoveFirst
$hasGenID
$hasTransactions
$genID
$raiseErrorFn
$isoDates
$cacheSecs
$memCache
$memCacheHost
$memCachePort
$memCacheCompress
$sysDate
$sysTimeStamp
$sysUTimeStamp
$arrayClass
$noNullStrings
$numCacheHits
$numCacheMisses
$pageExecuteCountRows
$uniqueSort
$leftOuter
$rightOuter
$ansiOuter
$autoRollback
$poorAffectedRows
$fnExecute
$fnCacheExecute
$blobEncodeType
$rsPrefix
$autoCommit
$transOff
$transCnt
$fetchMode
$null2null
$bulkBind
$_oldRaiseFn
$_transOK
$_connectionID
$_errorMsg
$_errorCode
$_queryID
$_isPersistentConnection
$_bindInputArray
$_evalAll
$_affected
$_logsql
$_transmode
$metaColumnsSQL
$metaPrimaryKeySQL
$lastQuery
$has_insertid
$_autocommit
$cursorType
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$dataProvider

$dataProvider : 

Type

$databaseType

$databaseType : 

Type

$database

$database : 

Type

$host

$host : 

Type

$user

$user : 

Type

$password

$password : 

Type

$debug

$debug : 

Type

$maxblobsize

$maxblobsize : 

Type

$concat_operator

$concat_operator : 

Type

$substr

$substr : 

Type

$length

$length : 

Type

$random

$random : 

Type

$upperCase

$upperCase : 

Type

$fmtDate

$fmtDate : 

Type

$fmtTimeStamp

$fmtTimeStamp : 

Type

$true

$true : 

Type

$false

$false : 

Type

$replaceQuote

$replaceQuote : 

Type

$nameQuote

$nameQuote : 

Type

$charSet

$charSet : 

Type

$metaDatabasesSQL

$metaDatabasesSQL : 

Type

$metaTablesSQL

$metaTablesSQL : 

Type

$uniqueOrderBy

$uniqueOrderBy : 

Type

$emptyDate

$emptyDate : 

Type

$emptyTimeStamp

$emptyTimeStamp : 

Type

$lastInsID

$lastInsID : 

Type

$hasInsertID

$hasInsertID : 

Type

$hasAffectedRows

$hasAffectedRows : 

Type

$hasTop

$hasTop : 

Type

$hasLimit

$hasLimit : 

Type

$readOnly

$readOnly : 

Type

$hasMoveFirst

$hasMoveFirst : 

Type

$hasGenID

$hasGenID : 

Type

$hasTransactions

$hasTransactions : 

Type

$genID

$genID : 

Type

$raiseErrorFn

$raiseErrorFn : 

Type

$isoDates

$isoDates : 

Type

$cacheSecs

$cacheSecs : 

Type

$memCache

$memCache : 

Type

$memCacheHost

$memCacheHost : 

Type

$memCachePort

$memCachePort : 

Type

$memCacheCompress

$memCacheCompress : 

Type

$sysDate

$sysDate : 

Type

$sysTimeStamp

$sysTimeStamp : 

Type

$sysUTimeStamp

$sysUTimeStamp : 

Type

$arrayClass

$arrayClass : 

Type

$noNullStrings

$noNullStrings : 

Type

$numCacheHits

$numCacheHits : 

Type

$numCacheMisses

$numCacheMisses : 

Type

$pageExecuteCountRows

$pageExecuteCountRows : 

Type

$uniqueSort

$uniqueSort : 

Type

$leftOuter

$leftOuter : 

Type

$rightOuter

$rightOuter : 

Type

$ansiOuter

$ansiOuter : 

Type

$autoRollback

$autoRollback : 

Type

$poorAffectedRows

$poorAffectedRows : 

Type

$fnExecute

$fnExecute : 

Type

$fnCacheExecute

$fnCacheExecute : 

Type

$blobEncodeType

$blobEncodeType : 

Type

$rsPrefix

$rsPrefix : 

Type

$autoCommit

$autoCommit : 

Type

$transOff

$transOff : 

Type

$transCnt

$transCnt : 

Type

$fetchMode

$fetchMode : 

Type

$null2null

$null2null : 

Type

$bulkBind

$bulkBind : 

Type

$_oldRaiseFn

$_oldRaiseFn : 

Type

$_transOK

$_transOK : 

Type

$_connectionID

$_connectionID : 

Type

$_errorMsg

$_errorMsg : 

Type

$_errorCode

$_errorCode : 

Type

$_queryID

$_queryID : 

Type

$_isPersistentConnection

$_isPersistentConnection : 

Type

$_bindInputArray

$_bindInputArray : 

Type

$_evalAll

$_evalAll : 

Type

$_affected

$_affected : 

Type

$_logsql

$_logsql : 

Type

$_transmode

$_transmode : 

Type

$metaColumnsSQL

$metaColumnsSQL : 

Type

$metaPrimaryKeySQL

$metaPrimaryKeySQL : 

Type

$lastQuery

$lastQuery : 

Type

$has_insertid

$has_insertid : 

Type

$_autocommit

$_autocommit : 

Type

$cursorType

$cursorType : 

Type

Methods

Version()

Version() 

ServerInfo()

ServerInfo() 

Get server version info.

..

IsConnected()

IsConnected() 

_findvers()

_findvers(  $str) 

Parameters

$str

outp()

outp(  $msg,   $newline = true) 

All error messages go through this bottleneck function.

You can define your own handler by defining the function name in ADODB_OUTP.

Parameters

$msg
$newline

Time()

Time() 

Connect()

Connect(  $argHostname = "",   $argUsername = "",   $argPassword = "",   $argDatabaseName = "",   $forceNew = false) : true

Connect to database

Parameters

$argHostname
$argUsername
$argPassword
$argDatabaseName
$forceNew

Returns

true —

or false

_nconnect()

_nconnect(  $argHostname,   $argUsername,   $argPassword,   $argDatabaseName) 

Parameters

$argHostname
$argUsername
$argPassword
$argDatabaseName

NConnect()

NConnect(  $argHostname = "",   $argUsername = "",   $argPassword = "",   $argDatabaseName = "") : true

Always force a new connection to database - currently only works with oracle

Parameters

$argHostname
$argUsername
$argPassword
$argDatabaseName

Returns

true —

or false

PConnect()

PConnect(  $argHostname = "",   $argUsername = "",   $argPassword = "",   $argDatabaseName = "") : \return

Establish persistent connect to database

Parameters

$argHostname
$argUsername
$argPassword
$argDatabaseName

Returns

\return —

true or false

outp_throw()

outp_throw(  $msg,   $src = 'WARN',   $sql = '') 

Parameters

$msg
$src
$sql

_CreateCache()

_CreateCache() 

SQLDate()

SQLDate(  $fmt,   $col = false) 

Parameters

$fmt
$col

Prepare()

Prepare(  $sql) : \return

Should prepare the sql statement and return the stmt resource.

For databases that do not support this, we return the $sql. To ensure compatibility with databases that do not support prepare:

$stmt = $db->Prepare("insert into table (id, name) values (?,?)"); $db->Execute($stmt,array(1,'Jill')) or die('insert failed'); $db->Execute($stmt,array(2,'Joe')) or die('insert failed');

Parameters

$sql

Returns

\return —

FALSE, or the prepared statement, or the original sql if if the database does not support prepare.

PrepareSP()

PrepareSP(  $sql,   $param = true) : \return

Some databases, eg. mssql require a different function for preparing stored procedures. So we cannot use Prepare().

Should prepare the stored procedure and return the stmt resource. For databases that do not support this, we return the $sql. To ensure compatibility with databases that do not support prepare:

Parameters

$sql
$param

Returns

\return —

FALSE, or the prepared statement, or the original sql if if the database does not support prepare.

Quote()

Quote(  $s) 

PEAR DB Compat

Parameters

$s

QMagic()

QMagic(  $s) 

Requested by "Karsten Dambekalns" <k.dambekalns@fishfarm.de>

Parameters

$s

q()

q(  $s) 

Parameters

$s

ErrorNative()

ErrorNative() 

PEAR DB Compat - do not use internally.

nextId()

nextId(  $seq_name) 

PEAR DB Compat - do not use internally.

Parameters

$seq_name

RowLock()

RowLock(  $tables,   $where,   $col = '1 as adodbignore') 

Lock a row, will escalate and lock the table if row locking not supported will normally free the lock at the end of the transaction

Parameters

$tables
$where

where clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock

$col

CommitLock()

CommitLock(  $table) 

Parameters

$table

RollbackLock()

RollbackLock(  $table) 

Parameters

$table

SetFetchMode()

SetFetchMode(  $mode) 

PEAR DB Compat - do not use internally.

The fetch modes for NUMERIC and ASSOC for PEAR DB and ADODB are identical for easy porting :-)

Parameters

$mode

Query()

Query(  $sql,   $inputarr = false) 

PEAR DB Compat - do not use internally.

Parameters

$sql
$inputarr

LimitQuery()

LimitQuery(  $sql,   $offset,   $count,   $params = false) 

PEAR DB Compat - do not use internally

Parameters

$sql
$offset
$count
$params

Disconnect()

Disconnect() 

PEAR DB Compat - do not use internally

Param()

Param(string  $name, string  $type = 'C') : string

Returns a placeholder for query parameters e.g. $DB->Param('a') will return - '?' for most databases - ':a' for Oracle - '$1', '$2', etc. for PostgreSQL

Parameters

string $name

parameter's name, false to force a reset of the number to 1 (for databases that require positioned params such as PostgreSQL; note that ADOdb will automatically reset this when executing a query )

string $type

(unused)

Returns

string —

query parameter placeholder

InParameter()

InParameter(  $stmt,   $var,   $name,   $maxLen = 4000,   $type = false) 

Parameters

$stmt
$var
$name
$maxLen
$type

OutParameter()

OutParameter(  $stmt,   $var,   $name,   $maxLen = 4000,   $type = false) 

Parameters

$stmt
$var
$name
$maxLen
$type

Parameter()

Parameter(  $stmt,   $var,   $name,   $isOutput = false,   $maxLen = 4000,   $type = false) 

Parameters

$stmt
$var
$name
$isOutput
$maxLen
$type

IgnoreErrors()

IgnoreErrors(  $saveErrs = false) 

Parameters

$saveErrs

StartTrans()

StartTrans(  $errfn = 'ADODB_TransMonitor') 

Improved method of initiating a transaction. Used together with CompleteTrans().

Advantages include:

a. StartTrans/CompleteTrans is nestable, unlike BeginTrans/CommitTrans/RollbackTrans. Only the outermost block is treated as a transaction.
b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.
c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block are disabled, making it backward compatible.

Parameters

$errfn

CompleteTrans()

CompleteTrans(  $autoComplete = true) 

Used together with StartTrans() to end a transaction. Monitors connection for sql errors, and will commit or rollback as appropriate.

Parameters

$autoComplete

FailTrans()

FailTrans() 

HasFailedTrans()

HasFailedTrans() 

Check if transaction has failed, only for Smart Transactions.

Execute()

Execute(  $sql,   $inputarr = false) : \RecordSet

Execute SQL

Parameters

$sql
$inputarr

Returns

\RecordSet —

or false

adodb_strip_count_keyword()

adodb_strip_count_keyword(  $sql) 

Parameters

$sql

_Execute()

_Execute(  $sql,   $inputarr = false) 

Parameters

$sql
$inputarr

CreateSequence()

CreateSequence(  $seqname = 'adodbseq',   $startID = 1) 

Parameters

$seqname
$startID

DropSequence()

DropSequence(  $seqname = 'adodbseq') 

Parameters

$seqname

GenID()

GenID(  $seqname = 'adodbseq',   $startID = 1) : 

Generates a sequence id and stores it in $this->genID; GenID is only available if $this->hasGenID = true;

Parameters

$seqname
$startID

Returns

if not supported, otherwise a sequence id

Insert_ID()

Insert_ID(  $table = '',   $column = '') : \the

Parameters

$table

string name of the table, not needed by all databases (eg. mysql), default ''

$column

string name of the column, not needed by all databases (eg. mysql), default ''

Returns

\the —

last inserted ID. Not all databases support this.

PO_Insert_ID()

PO_Insert_ID(  $table = "",   $id = "") : \the

Portable Insert ID. Pablo Roca <pabloroca#mvps.org>

Parameters

$table
$id

Returns

\the —

last inserted ID. All databases support this. But aware possible problems in multiuser environments. Heavy test this before deploying.

Affected_Rows()

Affected_Rows() : \#

Returns

\# —

rows affected by UPDATE/DELETE

ErrorMsg()

ErrorMsg() : \the

Returns

\the —

last error message

ErrorNo()

ErrorNo() : \the

Returns

\the —

last error number. Normally 0 means no error.

MetaError()

MetaError(  $err = false) 

Parameters

$err

MetaErrorMsg()

MetaErrorMsg(  $errno) 

Parameters

$errno

MetaPrimaryKeys()

MetaPrimaryKeys(  $table,   $owner = false) 

Parameters

$table
$owner

MetaForeignKeys()

MetaForeignKeys(  $table,   $owner = false,   $upper = false) 

Parameters

$table
$owner
$upper

SelectDB()

SelectDB(  $dbName) : true

Choose a database to connect to. Many databases do not support this.

Parameters

$dbName

Returns

true —

or false

SelectLimit()

SelectLimit(  $sql,   $nrows = -1,   $offset = -1,   $inputarr = false,   $secs2cache) : \the

Will select, getting rows from $offset (1-based), for $nrows.

This simulates the MySQL "select from table limit $offset,$nrows" , and the PostgreSQL "select from table limit $nrows offset $offset". Note that MySQL and PostgreSQL parameter ordering is the opposite of the other. eg. SelectLimit('select from table',3); will return rows 1 to 3 (1-based) SelectLimit('select from table',3,2); will return rows 3 to 5 (1-based)

Uses SELECT TOP for Microsoft databases (when $this->hasTop is set) BUG: Currently SelectLimit fails with $sql with LIMIT or TOP clause already set

Parameters

$sql
$nrows
$offset
$inputarr
$secs2cache

Returns

\the —

recordset ($rs->databaseType == 'array')

SerializableRS()

SerializableRS(  $rs) 

Create serializable recordset. Breaks rs link to connection.

Parameters

$rs

_rs2rs()

_rs2rs(  $rs,   $nrows = -1,   $offset = -1,   $close = true) : \the

Convert database recordset to an array recordset input recordset's cursor should be at beginning, and old $rs will be closed.

Parameters

$rs
$nrows
$offset
$close

Returns

\the —

new recordset

GetAll()

GetAll(  $sql,   $inputarr = false) 

Parameters

$sql
$inputarr

GetAssoc()

GetAssoc(  $sql,   $inputarr = false,   $force_array = false,   $first2cols = false) 

Parameters

$sql
$inputarr
$force_array
$first2cols

CacheGetAssoc()

CacheGetAssoc(  $secs2cache,   $sql = false,   $inputarr = false,   $force_array = false,   $first2cols = false) 

Parameters

$secs2cache
$sql
$inputarr
$force_array
$first2cols

GetOne()

GetOne(  $sql,   $inputarr = false) 

Return first element of first row of sql statement. Recordset is disposed for you.

Parameters

$sql
$inputarr

GetMedian()

GetMedian(  $table,   $field,   $where = '') 

Parameters

$table
$field
$where

CacheGetOne()

CacheGetOne(  $secs2cache,   $sql = false,   $inputarr = false) 

Parameters

$secs2cache
$sql
$inputarr

GetCol()

GetCol(  $sql,   $inputarr = false,   $trim = false) 

Parameters

$sql
$inputarr
$trim

CacheGetCol()

CacheGetCol(  $secs,   $sql = false,   $inputarr = false,   $trim = false) 

Parameters

$secs
$sql
$inputarr
$trim

Transpose()

Transpose(  $rs,   $addfieldnames = true) 

Parameters

$rs
$addfieldnames

OffsetDate()

OffsetDate(  $dayFraction,   $date = false) 

Parameters

$dayFraction
$date

GetArray()

GetArray(  $sql,   $inputarr = false) 

Parameters

$sql
$inputarr

CacheGetAll()

CacheGetAll(  $secs2cache,   $sql = false,   $inputarr = false) 

Parameters

$secs2cache
$sql
$inputarr

CacheGetArray()

CacheGetArray(  $secs2cache,   $sql = false,   $inputarr = false) 

Parameters

$secs2cache
$sql
$inputarr

GetRandRow()

GetRandRow(  $sql,   $arr = false) 

Parameters

$sql
$arr

GetRow()

GetRow(  $sql,   $inputarr = false) 

Return one row of sql statement. Recordset is disposed for you.

Note that SelectLimit should not be called.

Parameters

$sql
$inputarr

CacheGetRow()

CacheGetRow(  $secs2cache,   $sql = false,   $inputarr = false) 

Parameters

$secs2cache
$sql
$inputarr

Replace()

Replace(  $table,   $fieldArray,   $keyCol,   $autoQuote = false,   $has_autoinc = false) 

Insert or replace a single record. Note: this is not the same as MySQL's replace.

ADOdb's Replace() uses update-insert semantics, not insert-delete-duplicates of MySQL. Also note that no table locking is done currently, so it is possible that the record be inserted twice by two programs...

$this->Replace('products', array('prodname' =>"'Nails'","price" => 3.99), 'prodname');

$table table name $fieldArray associative array of data (you must quote strings yourself). $keyCol the primary key field name or if compound key, array of field names autoQuote set to true to use a hueristic to quote strings. Works with nulls and numbers but does not work with dates nor SQL functions. has_autoinc the primary key is an auto-inc field, so skip in insert.

Currently blob replace not supported

returns 0 = fail, 1 = update, 2 = insert

Parameters

$table
$fieldArray
$keyCol
$autoQuote
$has_autoinc

CacheSelectLimit()

CacheSelectLimit(  $secs2cache,   $sql,   $nrows = -1,   $offset = -1,   $inputarr = false) : \the

Will select, getting rows from $offset (1-based), for $nrows.

This simulates the MySQL "select from table limit $offset,$nrows" , and the PostgreSQL "select from table limit $nrows offset $offset". Note that MySQL and PostgreSQL parameter ordering is the opposite of the other. eg. CacheSelectLimit(15,'select from table',3); will return rows 1 to 3 (1-based) CacheSelectLimit(15,'select from table',3,2); will return rows 3 to 5 (1-based)

BUG: Currently CacheSelectLimit fails with $sql with LIMIT or TOP clause already set

Parameters

$secs2cache
$sql
$nrows
$offset
$inputarr

Returns

\the —

recordset ($rs->databaseType == 'array')

CacheFlush()

CacheFlush(  $sql = false,   $inputarr = false) 

Flush cached recordsets that match a particular $sql statement.

If $sql == false, then we purge all files in the cache.

Parameters

$sql
$inputarr

_gencachename()

_gencachename(  $sql,   $createdir) 

Private function to generate filename for caching.

Filename is generated based on:

  • sql statement
  • database type (oci8, ibase, ifx, etc)
  • database name
  • userid
  • setFetchMode (adodb 4.23)

When not in safe mode, we create 256 sub-directories in the cache directory ($ADODB_CACHE_DIR). Assuming that we can have 50,000 files per directory with good performance, then we can scale to 12.8 million unique cached recordsets. Wow!

Parameters

$sql
$createdir

CacheExecute()

CacheExecute(  $secs2cache,   $sql = false,   $inputarr = false) : \RecordSet

Execute SQL, caching recordsets.

Parameters

$secs2cache
$sql
$inputarr

Returns

\RecordSet —

or false

AutoExecute()

AutoExecute(  $table,   $fields_values,   $mode = 'INSERT',   $where = false,   $forceUpdate = true,   $magicq = false) 

Parameters

$table
$fields_values
$mode
$where
$forceUpdate
$magicq

GetUpdateSQL()

GetUpdateSQL(  $rs,   $arrFields,   $forceUpdate = false,   $magicq = false,   $force = null) 

Generates an Update Query based on an existing recordset.

$arrFields is an associative array of fields with the value that should be assigned.

Note: This function should only be used on a recordset that is run against a single table and sql should only be a simple select stmt with no groupby/orderby/limit

"Jonathan Younger" jyounger@unilab.com

Parameters

$rs
$arrFields
$forceUpdate
$magicq
$force

GetInsertSQL()

GetInsertSQL(  $rs,   $arrFields,   $magicq = false,   $force = null) 

Generates an Insert Query based on an existing recordset.

$arrFields is an associative array of fields with the value that should be assigned.

Note: This function should only be used on a recordset that is run against a single table.

Parameters

$rs
$arrFields
$magicq
$force

UpdateBlob()

UpdateBlob(  $table,   $column,   $val,   $where,   $blobtype = 'BLOB') 

Update a blob column, given a where clause. There are more sophisticated blob handling functions that we could have implemented, but all require a very complex API. Instead we have chosen something that is extremely simple to understand and use.

Note: $blobtype supports 'BLOB' and 'CLOB', default is BLOB of course.

Usage to update a $blobvalue which has a primary key blob_id=1 into a field blobtable.blobcolumn:

UpdateBlob('blobtable', 'blobcolumn', $blobvalue, 'blob_id=1');

Insert example:

$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');

Parameters

$table
$column
$val
$where
$blobtype

UpdateBlobFile()

UpdateBlobFile(  $table,   $column,   $path,   $where,   $blobtype = 'BLOB') 

Usage: UpdateBlob('TABLE', 'COLUMN', '/path/to/file', 'ID=1');

$blobtype supports 'BLOB' and 'CLOB'

$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); $conn->UpdateBlob('blobtable','blobcol',$blobpath,'id=1');

Parameters

$table
$column
$path
$where
$blobtype

BlobDecode()

BlobDecode(  $blobid) 

Parameters

$blobid

BlobEncode()

BlobEncode(  $blob) 

Parameters

$blob

SetCharSet()

SetCharSet(  $charset) 

Parameters

$charset

IfNull()

IfNull(  $field,   $ifNull) 

Parameters

$field
$ifNull

LogSQL()

LogSQL(  $enable = true) 

Parameters

$enable

GetCharSet()

GetCharSet() 

UpdateClob()

UpdateClob(  $table,   $column,   $val,   $where) 

Usage: UpdateClob('TABLE', 'COLUMN', $var, 'ID=1', 'CLOB');

$conn->Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)'); $conn->UpdateClob('clobtable','clobcol',$clob,'id=1');

Parameters

$table
$column
$val
$where

MetaType()

MetaType(  $t,   $len = -1,   $fieldobj = false) 

Parameters

$t
$len
$fieldobj

SetDateLocale()

SetDateLocale(  $locale = 'En') 

Change the SQL connection locale to a specified locale.

This is used to get the date formats written depending on the client locale.

Parameters

$locale

GetActiveRecordsClass()

GetActiveRecordsClass(mixed  $class, mixed  $table, mixed  $whereOrderBy = false, mixed  $bindarr = false, mixed  $primkeyArr = false, array  $extra = array(), mixed  $relations = array()) : void

GetActiveRecordsClass Performs an 'ALL' query

Parameters

mixed $class

This string represents the class of the current active record

mixed $table

Table used by the active record object

mixed $whereOrderBy

Where, order, by clauses

mixed $bindarr
mixed $primkeyArr
array $extra

Query extras: limit, offset...

mixed $relations

Associative array: table's foreign name, "hasMany", "belongsTo"

GetActiveRecords()

GetActiveRecords(  $table,   $where = false,   $bindarr = false,   $primkeyArr = false) 

Parameters

$table
$where
$bindarr
$primkeyArr

Close()

Close() 

Close Connection

BeginTrans()

BeginTrans() : true

Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().

Returns

true —

if succeeded or false if database does not support transactions

SetTransactionMode()

SetTransactionMode(  $transaction_mode) 

Parameters

$transaction_mode

MetaTransaction()

MetaTransaction(  $mode,   $db) 

Parameters

$mode
$db

CommitTrans()

CommitTrans(  $ok = true) : \true/false.

If database does not support transactions, always return true as data always commited

Parameters

$ok

set to false to rollback transaction, true to commit

Returns

\true/false.

RollbackTrans()

RollbackTrans() : \true/false.

If database does not support transactions, rollbacks always fail, so return false

Returns

\true/false.

MetaDatabases()

MetaDatabases() : \an

return the databases that the driver can connect to.

Some databases will return an empty array.

Returns

\an —

array of database names.

MetaProcedures()

MetaProcedures(  $NamePattern = false,   $catalog = null,   $schemaPattern = null) : array

List procedures or functions in an array.

Parameters

$NamePattern
$catalog
$schemaPattern

Returns

array —

of procedures on current database.

Array( [name_of_procedure] => Array( [type] => PROCEDURE or FUNCTION [catalog] => Catalog_name [schema] => Schema_name [remarks] => explanatory comment on the procedure ) )

MetaTables()

MetaTables(  $ttype = false,   $showSchema = false,   $mask = false) : array

Parameters

$ttype
$showSchema
$mask

Returns

array —

of tables for current database.

_findschema()

_findschema(  $table,   $schema) 

Parameters

$table
$schema

MetaColumns()

MetaColumns(  $table,   $normalize = true) : array

List columns in a database as an array of ADOFieldObjects.

See top of file for definition of object.

Parameters

$table

table name to query

$normalize

makes table name case-insensitive (required by some databases)

Returns

array —

of ADOFieldObjects for current table.

MetaIndexes()

MetaIndexes(  $table,   $primary = false,   $owner = false) : array

List indexes on a table as an array.

Parameters

$table
$primary
$owner

Returns

array —

of indexes on current table. Each element represents an index, and is itself an associative array.

Array( [name_of_index] => Array( [unique] => true or false [columns] => Array( [0] => firstname [1] => lastname ) ) )

MetaColumnNames()

MetaColumnNames(  $table,   $numIndexes = false,   $useattnum = false) : array

List columns names in a table as an array.

Parameters

$table
$numIndexes
$useattnum

Returns

array —

of column names for current table.

Concat()

Concat() : \concatenated

Different SQL databases used different methods to combine strings together.

This function provides a wrapper.

param s variable number of string parameters

Usage: $db->Concat($str1,$str2);

Returns

\concatenated —

string

DBDate()

DBDate(  $d,   $isfld = false) : \date

Converts a date "d" to a string that the database can understand.

Parameters

$d
$isfld

Returns

\date —

string in database date format

BindDate()

BindDate(  $d) 

Parameters

$d

BindTimeStamp()

BindTimeStamp(  $d) 

Parameters

$d

DBTimeStamp()

DBTimeStamp(  $ts,   $isfld = false) : \timestamp

Converts a timestamp "ts" to a string that the database can understand.

Parameters

$ts
$isfld

Returns

\timestamp —

string in database timestamp format

UnixDate()

UnixDate(  $v) : \date

Also in ADORecordSet.

Parameters

$v

is a date string in YYYY-MM-DD format

Returns

\date —

in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

UnixTimeStamp()

UnixTimeStamp(  $v) : \date

Also in ADORecordSet.

Parameters

$v

is a timestamp string in YYYY-MM-DD HH-NN-SS format

Returns

\date —

in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

UserDate()

UserDate(  $v,   $fmt = 'Y-m-d',   $gmt = false) : \a

Also in ADORecordSet.

Format database date based on user defined format.

Parameters

$v
$fmt
$gmt

Returns

\a —

date formated as user desires

UserTimeStamp()

UserTimeStamp(  $v,   $fmt = 'Y-m-d H:i:s',   $gmt = false) : \a

Parameters

$v
$fmt
$gmt

Returns

\a —

timestamp formated as user desires

escape()

escape(  $s,   $magic_quotes = false) 

Parameters

$s
$magic_quotes

addq()

addq(  $s,   $magic_quotes = false) 

Quotes a string, without prefixing nor appending quotes.

Parameters

$s
$magic_quotes

qstr()

qstr(  $s,   $magic_quotes = false) : \quoted

Correctly quotes a string so that all strings are escaped. We prefix and append to the string single-quotes.

An example is $db->qstr("Don't bother",magic_quotes_runtime());

Parameters

$s
$magic_quotes

Returns

\quoted —

string to be sent back to database

PageExecute()

PageExecute(  $sql,   $nrows,   $page,   $inputarr = false,   $secs2cache) : \the

Will select the supplied $page number from a recordset, given that it is paginated in pages of $nrows rows per page. It also saves two boolean values saying if the given page is the first and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.

See docs-adodb.htm#ex8 for an example of usage.

Parameters

$sql
$nrows
$page
$inputarr
$secs2cache

Returns

\the —

recordset ($rs->databaseType == 'array')

NOTE: phpLens uses a different algorithm and does not use PageExecute().

CachePageExecute()

CachePageExecute(  $secs2cache,   $sql,   $nrows,   $page,   $inputarr = false) : \the

Will select the supplied $page number from a recordset, given that it is paginated in pages of $nrows rows per page. It also saves two boolean values saying if the given page is the first and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.

Parameters

$secs2cache
$sql
$nrows
$page
$inputarr

Returns

\the —

recordset ($rs->databaseType == 'array')

ADODB_informix72()

ADODB_informix72() 

_insertid()

_insertid() 

_affectedrows()

_affectedrows() 

xMetaColumns()

xMetaColumns(  $table) 

Parameters

$table

_connect()

_connect(  $argHostname,   $argUsername,   $argPassword,   $argDatabasename) 

Parameters

$argHostname
$argUsername
$argPassword
$argDatabasename

_pconnect()

_pconnect(  $argHostname,   $argUsername,   $argPassword,   $argDatabasename) 

Parameters

$argHostname
$argUsername
$argPassword
$argDatabasename

_query()

_query(  $sql,   $inputarr = false) 

Parameters

$sql
$inputarr

_close()

_close()