Zikula 1.0.1
[ class tree: Zikula 1.0.1 ] [ index: Zikula 1.0.1 ] [ all elements ]

Class: ADOConnection

Source Location: /includes/classes/adodb/adodb.inc.php

Class Overview


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


Variables

Methods


Child classes:

Connection object. For connecting to databases, and executing queries.
ADODB_csv
Connection object. For connecting to databases, and executing queries.
ADODB_db2
Connection object. For connecting to databases, and executing queries.
ADODB_fbsql
Connection object. For connecting to databases, and executing queries.
ADODB_ibase
Connection object. For connecting to databases, and executing queries.
ADODB_informix72
Connection object. For connecting to databases, and executing queries.
ADODB_ldap
Connection object. For connecting to databases, and executing queries.
ADODB_mssql
Connection object. For connecting to databases, and executing queries.
ADODB_mysql
Connection object. For connecting to databases, and executing queries.
ADODB_mysqli
Connection object. For connecting to databases, and executing queries.
ADODB_oci8
Connection object. For connecting to databases, and executing queries.
ADODB_odbc
Connection object. For connecting to databases, and executing queries.
ADODB_odbtp
Connection object. For connecting to databases, and executing queries.
ADODB_oracle
Connection object. For connecting to databases, and executing queries.
ADODB_pdo
Connection object. For connecting to databases, and executing queries.
ADODB_postgres64
Connection object. For connecting to databases, and executing queries.
ADODB_sqlite
Connection object. For connecting to databases, and executing queries.
ADODB_sybase
Connection object. For connecting to databases, and executing queries.

Class Details

[line 237]
Connection object. For connecting to databases, and executing queries.



[ Top ]


Class Variables

$ansiOuter =  false

[line 299]


Type:   mixed


[ Top ]

$arrayClass =  'ADORecordSet_array'

[line 290]


Type:   mixed


[ Top ]

$autoCommit =  true

[line 308]


Type:   mixed


[ Top ]

$autoRollback =  false

[line 300]


Type:   mixed


[ Top ]

$blobEncodeType =  false

[line 305]


Type:   mixed


[ Top ]

$cacheSecs =  3600

[line 280]


Type:   mixed


[ Top ]

$charSet = false

[line 260]


Type:   mixed


[ Top ]

$concat_operator =  '+'

[line 249]


Type:   mixed


[ Top ]

$database =  ''

[line 243]


Type:   mixed


[ Top ]

$databaseType =  ''

[line 242]


Type:   mixed


[ Top ]

$dataProvider =  'native'

[line 241]


Type:   mixed


[ Top ]

$debug =  false

[line 247]


Type:   mixed


[ Top ]

$emptyDate =  ' '

[line 264]


Type:   mixed


[ Top ]

$emptyTimeStamp =  ' '

[line 265]


Type:   mixed


[ Top ]

$false =  '0'

[line 257]


Type:   mixed


[ Top ]

$fetchMode = false

[line 312]


Type:   mixed


[ Top ]

$fmtDate =  "'Y-m-d'"

[line 254]


Type:   mixed


[ Top ]

$fmtTimeStamp =  "'Y-m-d, h:i:s A'"

[line 255]


Type:   mixed


[ Top ]

$fnCacheExecute =  false

[line 304]


Type:   mixed


[ Top ]

$fnExecute =  false

[line 303]


Type:   mixed


[ Top ]

$genID =  0

[line 277]


Type:   mixed


[ Top ]

$hasAffectedRows =  false

[line 269]


Type:   mixed


[ Top ]

$hasGenID =  false

[line 274]


Type:   mixed


[ Top ]

$hasInsertID =  false

[line 268]


Type:   mixed


[ Top ]

$hasLimit =  false

[line 271]


Type:   mixed


[ Top ]

$hasMoveFirst =  false

[line 273]


Type:   mixed


[ Top ]

$hasTop =  false

[line 270]


Type:   mixed


[ Top ]

$hasTransactions =  true

[line 275]


Type:   mixed


[ Top ]

$host =  ''

[line 244]


Type:   mixed


[ Top ]

$isoDates =  false

[line 279]


Type:   mixed


[ Top ]

$lastInsID =  false

[line 266]


Type:   mixed


[ Top ]

$leftOuter =  false

[line 297]


Type:   mixed


[ Top ]

$length =  'length'

[line 251]


Type:   mixed


[ Top ]

$maxblobsize =  262144

[line 248]


Type:   mixed


[ Top ]

$memCache =  false

[line 283]


Type:   mixed


[ Top ]

$memCacheCompress =  false

[line 286]


Type:   mixed


[ Top ]

$memCacheHost =

[line 284]


Type:   mixed


[ Top ]

$memCachePort =  11211

[line 285]


Type:   mixed


[ Top ]

$metaDatabasesSQL =  ''

[line 261]


Type:   mixed


[ Top ]

$metaTablesSQL =  ''

[line 262]


Type:   mixed


[ Top ]

$nameQuote =  '"'

[line 259]


Type:   mixed


[ Top ]

$noNullStrings =  false

[line 292]


Type:   mixed


[ Top ]

$null2null =  'null'

[line 314]


Type:   mixed


[ Top ]

$numCacheHits =  0

[line 293]


Type:   mixed


[ Top ]

$numCacheMisses =  0

[line 294]


Type:   mixed


[ Top ]

$pageExecuteCountRows =  true

[line 295]


Type:   mixed


[ Top ]

$password =  ''

[line 246]


Type:   mixed


[ Top ]

$poorAffectedRows =  false

[line 301]


Type:   mixed


[ Top ]

$raiseErrorFn =  false

[line 278]


Type:   mixed


[ Top ]

$random =  'rand()'

[line 252]


Type:   mixed


[ Top ]

$readOnly =  false

[line 272]


Type:   mixed


[ Top ]

$replaceQuote =  "\\'"

[line 258]


Type:   mixed


[ Top ]

$rightOuter =  false

[line 298]


Type:   mixed


[ Top ]

$rsPrefix =  "ADORecordSet_"

[line 306]


Type:   mixed


[ Top ]

$substr =  'substr'

[line 250]


Type:   mixed


[ Top ]

$sysDate =  false

[line 288]


Type:   mixed


[ Top ]

$sysTimeStamp =  false

[line 289]


Type:   mixed


[ Top ]

$transCnt =  0

[line 310]


Type:   mixed


[ Top ]

$transOff =  0

[line 309]


Type:   mixed


[ Top ]

$true =  '1'

[line 256]


Type:   mixed


[ Top ]

$uniqueOrderBy =  false

[line 263]


Type:   mixed


[ Top ]

$uniqueSort =  false

[line 296]


Type:   mixed


[ Top ]

$upperCase =  'upper'

[line 253]


Type:   mixed


[ Top ]

$user =  ''

[line 245]


Type:   mixed


[ Top ]

$_affected =  false

[line 329]


Type:   mixed


[ Top ]

$_bindInputArray =  false

[line 327]


Type:   mixed


[ Top ]

$_connectionID =  false

[line 320]


Type:   mixed


[ Top ]

$_errorCode =  false

[line 323]


Type:   mixed


[ Top ]

$_errorMsg =  false

[line 321]


Type:   mixed


[ Top ]

$_evalAll =  false

[line 328]


Type:   mixed


[ Top ]

$_isPersistentConnection =  false

[line 326]


Type:   mixed


[ Top ]

$_logsql =  false

[line 330]


Type:   mixed


[ Top ]

$_oldRaiseFn =   false

[line 318]


Type:   mixed


[ Top ]

$_queryID =  false

[line 324]


Type:   mixed


[ Top ]

$_transmode =  ''

[line 331]


Type:   mixed


[ Top ]

$_transOK =  null

[line 319]


Type:   mixed


[ Top ]



Class Methods


constructor ADOConnection [line 338]

ADOConnection ADOConnection( )

Constructor



[ Top ]

method addq [line 2573]

void addq( $s, [ $magic_quotes = false])

Quotes a string, without prefixing nor appending quotes.



Parameters:

   $s  
   $magic_quotes  

[ Top ]

method Affected_Rows [line 1032]

# Affected_Rows( )



Tags:

return:  rows affected by UPDATE/DELETE


[ Top ]

method AutoExecute [line 1839]

void &AutoExecute( $table, $fields_values, [ $mode = 'INSERT'], [ $where = FALSE], [ $forceUpdate = true], [ $magicq = false])



Parameters:

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

[ Top ]

method BeginTrans [line 2126]


method BindDate [line 2433]

void BindDate( $d)



Overridden in child classes as:

ADODB_oci8::BindDate()
ADODB_oracle::BindDate()

Parameters:

   $d  

[ Top ]

method BindTimeStamp [line 2441]

void BindTimeStamp( $d)



Overridden in child classes as:

ADODB_oci8::BindTimeStamp()
ADODB_oracle::BindTimeStamp()

Parameters:

   $d  

[ Top ]

method BlobDecode [line 1964]

void BlobDecode( $blob)



Overridden in child classes as:

ADODB_ibase::BlobDecode()
ADODB_informix72::BlobDecode()
ADODB_postgres64::BlobDecode()

Parameters:

   $blob  

[ Top ]

method BlobEncode [line 1969]

void BlobEncode( $blob)



Overridden in child classes as:

ADODB_ibase::BlobEncode()
ADODB_postgres64::BlobEncode()

Parameters:

   $blob  

[ Top ]

method CacheExecute [line 1720]

RecordSet &CacheExecute( [secs2cache] $secs2cache, [sql $sql = false], [[inputarr] $inputarr = false])

Execute SQL, caching recordsets.



Tags:

return:  or false


Parameters:

[secs2cache]   $secs2cache   seconds to cache data, set to 0 to force query. This is an optional parameter.
sql   $sql   SQL statement to execute
[inputarr]   $inputarr   holds the input data to bind to

[ Top ]

method CacheFlush [line 1571]

void 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  

[ Top ]

method CacheGetAll [line 1426]

void &CacheGetAll( $secs2cache, [ $sql = false], [ $inputarr = false])



Parameters:

   $secs2cache  
   $sql  
   $inputarr  

[ Top ]

method CacheGetArray [line 1432]

void &CacheGetArray( $secs2cache, [ $sql = false], [ $inputarr = false])



Parameters:

   $secs2cache  
   $sql  
   $inputarr  

[ Top ]

method CacheGetAssoc [line 1277]

void &CacheGetAssoc( $secs2cache, [ $sql = false], [ $inputarr = false], [ $force_array = false], [ $first2cols = false])



Parameters:

   $secs2cache  
   $sql  
   $inputarr  
   $force_array  
   $first2cols  

[ Top ]

method CacheGetCol [line 1353]

void CacheGetCol( $secs, [ $sql = false], [ $inputarr = false], [ $trim = false])



Parameters:

   $secs  
   $sql  
   $inputarr  
   $trim  

[ Top ]

method CacheGetOne [line 1317]

void CacheGetOne( $secs2cache, [ $sql = false], [ $inputarr = false])



Parameters:

   $secs2cache  
   $sql  
   $inputarr  

[ Top ]

method CacheGetRow [line 1487]

void &CacheGetRow( $secs2cache, [ $sql = false], [ $inputarr = false])



Parameters:

   $secs2cache  
   $sql  
   $inputarr  

[ Top ]

method CachePageExecute [line 2670]

the &CachePageExecute( secs2cache $secs2cache, sql $sql, nrows $nrows, page $page, [[inputarr] $inputarr = false])

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.



Tags:

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


Parameters:

secs2cache   $secs2cache   seconds to cache data, set to 0 to force query
sql   $sql  
nrows   $nrows   is the number of rows per page to get
page   $page   is the page number to get (1-based)
[inputarr]   $inputarr   array of bind variables

[ Top ]

method CacheSelectLimit [line 1547]

the &CacheSelectLimit( [secs2cache] $secs2cache, sql $sql, [[offset] $nrows = -1], [[nrows] $offset = -1], [[inputarr] $inputarr = false])

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




Tags:

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


Parameters:

[secs2cache]   $secs2cache   seconds to cache data, set to 0 to force query. This is optional
sql   $sql  
[offset]   $nrows   is the row to start calculations from (1-based)
[nrows]   $offset   is the number of rows to get
[inputarr]   $inputarr   array of bind variables

[ Top ]

method Close [line 2114]

void Close( )

Close Connection



[ Top ]

method CommitLock [line 606]

void CommitLock( $table)



Parameters:

   $table  

[ Top ]

method CommitTrans [line 2191]


method CompleteTrans [line 767]

void CompleteTrans( [ $autoComplete = true])



Parameters:

   $autoComplete  

[ Top ]

method Concat [line 2406]

concatenated Concat( )

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);




Tags:

return:  string


Overridden in child classes as:

ADODB_fbsql::Concat()
ADODB_mssql::Concat()
ADODB_mysql::Concat()
ADODB_mysqli::Concat()

[ Top ]

method Connect [line 419]

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

Connect to database



Tags:

return:  or false


Parameters:

[argHostname]   $argHostname   Host to connect to
[argUsername]   $argUsername   Userid to login
[argPassword]   $argPassword   Associated password
[argDatabaseName]   $argDatabaseName   database
[forceNew]   $forceNew   force new connection

[ Top ]

method CreateSequence [line 949]

void CreateSequence( [ $seqname = 'adodbseq'], [ $startID = 1])



Overridden in child classes as:

ADODB_db2::CreateSequence()
ADODB_ibase::CreateSequence()
ADODB_mssql::CreateSequence()
ADODB_mysql::CreateSequence()
ADODB_mysqli::CreateSequence()
ADODB_odbc::CreateSequence()
ADODB_odbtp::CreateSequence()
ADODB_sqlite::CreateSequence()

Parameters:

   $seqname  
   $startID  

[ Top ]

method DBDate [line 2420]

date DBDate( d $d)

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



Tags:

return:  string in database date format


Overridden in child classes as:

ADODB_oci8::DBDate()
ADODB_oracle::DBDate()

Parameters:

d   $d   a date in Unix date time format.

[ Top ]

method DBTimeStamp [line 2457]

timestamp DBTimeStamp( ts $ts)

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



Tags:

return:  string in database timestamp format


Overridden in child classes as:

ADODB_db2::DBTimeStamp()
ADODB_oci8::DBTimeStamp()
ADODB_oracle::DBTimeStamp()

Parameters:

ts   $ts   a timestamp in Unix date time format.

[ Top ]

method Disconnect [line 663]

void Disconnect( )

PEAR DB Compat - do not use internally



[ Top ]

method DropSequence [line 955]

void DropSequence( [ $seqname = 'adodbseq'])



Overridden in child classes as:

ADODB_db2::DropSequence()
ADODB_ibase::DropSequence()
ADODB_odbc::DropSequence()
ADODB_odbtp::DropSequence()
ADODB_sqlite::DropSequence()

Parameters:

   $seqname  

[ Top ]

method ErrorMsg [line 1050]


method ErrorNative [line 580]

void ErrorNative( )

PEAR DB Compat - do not use internally.



[ Top ]

method ErrorNo [line 1060]


method escape [line 2565]

void escape( $s, [ $magic_quotes = false])



Parameters:

   $s  
   $magic_quotes  

[ Top ]

method Execute [line 822]

RecordSet &Execute( sql $sql, [[inputarr] $inputarr = false])

Execute SQL



Tags:

return:  or false


Overridden in child classes as:

ADODB_oci8::Execute()
Execute SQL

Parameters:

sql   $sql   SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text)
[inputarr]   $inputarr   holds the input data to bind to. Null elements will be set to null.

[ Top ]

method FailTrans [line 794]

void FailTrans( )



[ Top ]

method GenID [line 969]

0 GenID( [seqname $seqname = 'adodbseq'], [startID $startID = 1])

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



Tags:

return:  if not supported, otherwise a sequence id


Overridden in child classes as:

ADODB_db2::GenID()
ADODB_ibase::GenID()
ADODB_mssql::GenID()
ADODB_mysql::GenID()
ADODB_mysqli::GenID()
ADODB_odbc::GenID()
ADODB_odbtp::GenID()
ADODB_sqlite::GenID()

Parameters:

seqname   $seqname   name of sequence to use
startID   $startID   if sequence does not exist, start at this ID

[ Top ]

method GetActiveRecords [line 2105]

void &GetActiveRecords( $table, [ $where = false], [ $bindarr = false], [ $primkeyArr = false])



Parameters:

   $table  
   $where  
   $bindarr  
   $primkeyArr  

[ Top ]

method GetActiveRecordsClass [line 2068]

void &GetActiveRecordsClass( $class, $table, [ $whereOrderBy = false], [ $bindarr = false], [ $primkeyArr = false])



Parameters:

   $class  
   $table  
   $whereOrderBy  
   $bindarr  
   $primkeyArr  

[ Top ]

method GetAll [line 1260]

void &GetAll( $sql, [ $inputarr = false])



Parameters:

   $sql  
   $inputarr  

[ Top ]

method GetArray [line 1405]

void &GetArray( sql $sql, [[inputarr] $inputarr = false])



Parameters:

sql   $sql   SQL statement
[inputarr]   $inputarr   input bind array

[ Top ]

method GetAssoc [line 1266]

void &GetAssoc( $sql, [ $inputarr = false], [ $force_array = false], [ $first2cols = false])



Parameters:

   $sql  
   $inputarr  
   $force_array  
   $first2cols  

[ Top ]

method GetCharSet [line 1997]

void GetCharSet( )



Overridden in child classes as:

ADODB_mysqli::GetCharSet()
ADODB_postgres7::GetCharSet()

[ Top ]

method GetCol [line 1330]

void GetCol( $sql, [ $inputarr = false], [ $trim = false])



Parameters:

   $sql  
   $inputarr  
   $trim  

[ Top ]

method GetInsertSQL [line 1909]

void 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  

[ Top ]

method GetOne [line 1299]

void GetOne( sql $sql, [[inputarr] $inputarr = false])

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



Overridden in child classes as:

ADODB_mysql::GetOne()
ADODB_mysqli::GetOne()

Parameters:

sql   $sql   SQL statement
[inputarr]   $inputarr   input bind array

[ Top ]

method GetRandRow [line 1454]

void GetRandRow( $sql, [ $arr = false])



Overridden in child classes as:

ADODB_oci8::GetRandRow()

Parameters:

   $sql  
   $arr  

[ Top ]

method GetRow [line 1467]

void &GetRow( sql $sql, [[inputarr] $inputarr = false])

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



Parameters:

sql   $sql   SQL statement
[inputarr]   $inputarr   input bind array

[ Top ]

method GetUpdateSQL [line 1884]

void 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  

[ Top ]

method HasFailedTrans [line 809]

void HasFailedTrans( )



[ Top ]

method IfNull [line 1979]


method IgnoreErrors [line 720]

void IgnoreErrors( [ $saveErrs = false])



Parameters:

   $saveErrs  

[ Top ]

method InParameter [line 685]

void InParameter( &$stmt, &$var, $name, [ $maxLen = 4000], [ $type = false])



Overridden in child classes as:

ADODB_pdo::InParameter()

Parameters:

   &$stmt  
   &$var  
   $name  
   $maxLen  
   $type  

[ Top ]

method Insert_ID [line 1002]

the Insert_ID( [$table $table = ''], [$column $column = ''])



Tags:

return:  last inserted ID. Not all databases support this.


Parameters:

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

[ Top ]

method IsConnected [line 361]

void IsConnected( )



[ Top ]

method LimitQuery [line 652]

void &LimitQuery( $sql, $offset, $count, [ $params = false])

PEAR DB Compat - do not use internally



Parameters:

   $sql  
   $offset  
   $count  
   $params  

[ Top ]

method LogSQL [line 1984]

void LogSQL( [ $enable = true])



Parameters:

   $enable  

[ Top ]

method MetaColumnNames [line 2374]

array &MetaColumnNames( table $table, [ $numIndexes = false], [ $useattnum = false])

List columns names in a table as an array.



Tags:

return:  of column names for current table.


Overridden in child classes as:

ADODB_SAPDB::MetaColumnNames()

Parameters:

table   $table   table name to query
   $numIndexes  
   $useattnum  

[ Top ]

method MetaColumns [line 2303]


method MetaDatabases [line 2210]

an MetaDatabases( )

return the databases that the driver can connect to.

Some databases will return an empty array.




Tags:

return:  array of database names.


Overridden in child classes as:

ADODB_csv::MetaDatabases()
ADODB_fbsql::MetaDatabases()
ADODB_mssql::MetaDatabases()
ADODB_mysql::MetaDatabases()
ADODB_mysqli::MetaDatabases()
ADODB_sybase_ase::MetaDatabases()

[ Top ]

method MetaError [line 1065]

void MetaError( [ $err = false])



Parameters:

   $err  

[ Top ]

method MetaErrorMsg [line 1072]

void MetaErrorMsg( $errno)



Parameters:

   $errno  

[ Top ]

method MetaForeignKeys [line 1101]

assoc MetaForeignKeys( $table, [ $owner = false], [ $upper = false])



Tags:

return:  array where keys are tables, and values are foreign keys


Overridden in child classes as:

ADODB_db2::MetaForeignKeys()
ADODB_informix72::MetaForeignKeys()
ADODB_mssql::MetaForeignKeys()
ADODB_mysql::MetaForeignKeys()
ADODB_mysqli::MetaForeignKeys()
ADODB_oci8::MetaForeignKeys()
ADODB_odbc_mssql::MetaForeignKeys()
ADODB_odbtp::MetaForeignKeys()
ADODB_postgres7::MetaForeignKeys()

Parameters:

   $table  
   $owner  
   $upper  

[ Top ]

method MetaIndexes [line 2362]

array &MetaIndexes( table $table, [primary $primary = false], [ $owner = false])

List indexes on a table as an array.



Tags:

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


Overridden in child classes as:

ADODB_ibase::MetaIndexes()
ADODB_mssql::MetaIndexes()
ADODB_mysql::MetaIndexes()
ADODB_mysqli::MetaIndexes()
ADODB_oci8::MetaIndexes()
ADODB_ODBC_DB2::MetaIndexes()
ADODB_odbc_mssql::MetaIndexes()
ADODB_SAPDB::MetaIndexes()
ADODB_postgres64::MetaIndexes()
ADODB_sqlite::MetaIndexes()

Parameters:

table   $table   table name to query
primary   $primary   true to only show primary keys. Not actually used for most databases
   $owner  

[ Top ]

method MetaPrimaryKeys [line 1081]

an MetaPrimaryKeys( $table, [ $owner = false])



Tags:

return:  array with the primary key columns in it.


Overridden in child classes as:

ADODB_db2::MetaPrimaryKeys()
ADODB_ibase::MetaPrimaryKeys()
ADODB_mssql::MetaPrimaryKeys()
ADODB_oci8::MetaPrimaryKeys()
ADODB_odbc::MetaPrimaryKeys()
ADODB_odbc_mssql::MetaPrimaryKeys()
ADODB_SAPDB::MetaPrimaryKeys()
ADODB_odbtp::MetaPrimaryKeys()
ADODB_sybase::MetaPrimaryKeys()

Parameters:

   $table  
   $owner  

[ Top ]

method MetaTables [line 2241]

array &MetaTables( [ttype $ttype = false], [showSchema $showSchema = false], [mask $mask = false])



Tags:

return:  of tables for current database.


Overridden in child classes as:

ADODB_ado::MetaTables()
ADODB_db2::MetaTables()
ADODB_mssql::MetaTables()
ADODB_mysql::MetaTables()
ADODB_mysqli::MetaTables()
ADODB_oci8::MetaTables()
ADODB_odbc::MetaTables()
ADODB_ODBC_DB2::MetaTables()
ADODB_odbc_mssql::MetaTables()
ADODB_odbc_oracle::MetaTables()
ADODB_odbtp::MetaTables()
ADODB_pdo::MetaTables()
ADODB_pdo_base::MetaTables()
ADODB_pdo_oci::MetaTables()
ADODB_pdo_mssql::MetaTables()
ADODB_pdo_mysql::MetaTables()
ADODB_pdo_pgsql::MetaTables()
ADODB_postgres64::MetaTables()
ADODB_sybase_ase::MetaTables()

Parameters:

ttype   $ttype   can either be 'VIEW' or 'TABLE' or false. If false, both views and tables are returned. "VIEW" returns only views "TABLE" returns only tables
showSchema   $showSchema   returns the schema/user with the table name, eg. USER.TABLE
mask   $mask   is the input mask - only supported by oci8 and postgresql

[ Top ]

method MetaTransaction [line 2144]

void MetaTransaction( $mode, $db)



Parameters:

   $mode  
   $db  

[ Top ]

method MetaType [line 2016]

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



Parameters:

   $t  
   $len  
   $fieldobj  

[ Top ]

method NConnect [line 465]

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

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



Tags:

return:  or false


Parameters:

[argHostname]   $argHostname   Host to connect to
[argUsername]   $argUsername   Userid to login
[argPassword]   $argPassword   Associated password
[argDatabaseName]   $argDatabaseName   database

[ Top ]

method nextId [line 589]

void nextId( $seq_name)

PEAR DB Compat - do not use internally.



Parameters:

   $seq_name  

[ Top ]

method OffsetDate [line 1393]

void OffsetDate( $dayFraction, [ $date = false])



Overridden in child classes as:

ADODB_mysql::OffsetDate()
ADODB_mysqli::OffsetDate()
ADODB_pdo_mysql::OffsetDate()
ADODB_postgres64::OffsetDate()

Parameters:

   $dayFraction  
   $date  

[ Top ]

method outp [line 376]

void 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  

[ Top ]

method OutParameter [line 692]

void OutParameter( &$stmt, &$var, $name, [ $maxLen = 4000], [ $type = false])



Parameters:

   &$stmt  
   &$var  
   $name  
   $maxLen  
   $type  

[ Top ]

method PageExecute [line 2648]

the &PageExecute( sql $sql, nrows $nrows, page $page, [[inputarr] $inputarr = false], [[secs2cache] $secs2cache = 0])

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 readme.htm#ex8 for an example of usage.




Tags:

return:  

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

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



Parameters:

sql   $sql  
nrows   $nrows   is the number of rows per page to get
page   $page   is the page number to get (1-based)
[inputarr]   $inputarr   array of bind variables
[secs2cache]   $secs2cache   is a private parameter only used by jlim

[ Top ]

method Param [line 677]

void Param( $name, [ $type = 'C'])



Overridden in child classes as:

ADODB_oci8::Param()
ADODB_oci8po::Param()

Parameters:

   $name  
   $type  

[ Top ]

method Parameter [line 714]

void Parameter( &$stmt, &$var, $name, [ $isOutput = false], [ $maxLen = 4000], [ $type = false])



Overridden in child classes as:

ADODB_mssql::Parameter()
ADODB_oci8::Parameter()
ADODB_odbtp::Parameter()

Parameters:

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

[ Top ]

method PConnect [line 480]

return PConnect( [[argHostname] $argHostname = ""], [[argUsername] $argUsername = ""], [[argPassword] $argPassword = ""], [[argDatabaseName] $argDatabaseName = ""])

Establish persistent connect to database



Tags:

return:  true or false


Parameters:

[argHostname]   $argHostname   Host to connect to
[argUsername]   $argUsername   Userid to login
[argPassword]   $argPassword   Associated password
[argDatabaseName]   $argDatabaseName   database

[ Top ]

method PO_Insert_ID [line 1020]

the PO_Insert_ID( [ $table = ""], [ $id = ""])

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



Tags:

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


Parameters:

   $table  
   $id  

[ Top ]

method Prepare [line 531]

return Prepare( sql $sql)

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');




Tags:

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


Overridden in child classes as:

ADODB_db2::Prepare()
ADODB_ibase::Prepare()
ADODB_mssql::Prepare()
ADODB_mysqli::Prepare()
ADODB_oci8::Prepare()
ADODB_oci8po::Prepare()
ADODB_odbc::Prepare()
ADODB_odbtp::Prepare()
ADODB_pdo::Prepare()

Parameters:

sql   $sql   SQL to send to database

[ Top ]

method PrepareSP [line 550]

return PrepareSP( sql $sql, [ $param = true])

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:




Tags:

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


Overridden in child classes as:

ADODB_mssql::PrepareSP()
ADODB_mssqlpo::PrepareSP()
ADODB_odbtp::PrepareSP()

Parameters:

sql   $sql   SQL to send to database
   $param  

[ Top ]

method q [line 571]

void q( &$s)



Parameters:

   &$s  

[ Top ]

method QMagic [line 566]

void QMagic( $s)



Parameters:

   $s  

[ Top ]

method qstr [line 2607]

quoted qstr( s $s, [[magic_quotes] $magic_quotes = false])

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());




Tags:

return:  string to be sent back to database


Overridden in child classes as:

ADODB_mysql::qstr()
ADODB_mysqli::qstr()
ADODB_oci8::qstr()
Quotes a string.
ADODB_vfp::qstr()
ADODB_postgres64::qstr()

Parameters:

s   $s   the string to quote
[magic_quotes]   $magic_quotes   if $s is GET/POST var, set to get_magic_quotes_gpc(). This undoes the stupidity of magic quotes for GPC.

[ Top ]

method Query [line 641]

void &Query( $sql, [ $inputarr = false])

PEAR DB Compat - do not use internally.



Parameters:

   $sql  
   $inputarr  

[ Top ]

method Quote [line 558]

void Quote( $s)

PEAR DB Compat



Parameters:

   $s  

[ Top ]

method Replace [line 1520]

void 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  

[ Top ]

method RollbackLock [line 611]

void RollbackLock( $table)



Parameters:

   $table  

[ Top ]

method RollbackTrans [line 2200]


method RowLock [line 601]

void RowLock( $table $table, $where $where)

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



Overridden in child classes as:

ADODB_ibase::RowLock()
ADODB_informix72::RowLock()
ADODB_mssql::RowLock()
ADODB_mysqlt::RowLock()
ADODB_mysqli::RowLock()
ADODB_oci8::RowLock()
ADODB_ODBC_DB2::RowLock()
ADODB_postgres64::RowLock()
ADODB_sybase::RowLock()

Parameters:

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

[ Top ]

method SelectDB [line 1111]

true SelectDB( dbName $dbName)

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



Tags:

return:  or false


Overridden in child classes as:

ADODB_fbsql::SelectDB()
ADODB_ibase::SelectDB()
ADODB_ldap::SelectDB()
ADODB_mssql::SelectDB()
ADODB_mysql::SelectDB()
ADODB_mysqli::SelectDB()
ADODB_oci8::SelectDB()
ADODB_odbtp::SelectDB()
ADODB_sybase::SelectDB()

Parameters:

dbName   $dbName   is the name of the database to select

[ Top ]

method SelectLimit [line 1134]

the &SelectLimit( sql $sql, [[offset] $nrows = -1], [[nrows] $offset = -1], [[inputarr] $inputarr = false], [[secs2cache] $secs2cache = 0])

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




Tags:

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


Overridden in child classes as:

ADODB_csv::SelectLimit()
ADODB_borland_ibase::SelectLimit()
ADODB_firebird::SelectLimit()
ADODB_mssql::SelectLimit()
ADODB_mysql::SelectLimit()
ADODB_mysqli::SelectLimit()
ADODB_oci8::SelectLimit()
ADODB_oci805::SelectLimit()
ADODB_ODBC_DB2::SelectLimit()
ADODB_odbc_mssql::SelectLimit()
ADODB_vfp::SelectLimit()
ADODB_odbtp::SelectLimit()
ADODB_pdo::SelectLimit()
ADODB_pdo_base::SelectLimit()
ADODB_pdo_mssql::SelectLimit()
ADODB_pdo_mysql::SelectLimit()
ADODB_pdo_pgsql::SelectLimit()
ADODB_postgres7::SelectLimit()
ADODB_sqlite::SelectLimit()
ADODB_sybase::SelectLimit()

Parameters:

sql   $sql  
[offset]   $nrows   is the row to start calculations from (1-based)
[nrows]   $offset   is the number of rows to get
[inputarr]   $inputarr   array of bind variables
[secs2cache]   $secs2cache   is a private parameter only used by jlim

[ Top ]

method SerializableRS [line 1202]

void &SerializableRS( rs &$rs)

Create serializable recordset. Breaks rs link to connection.



Parameters:

rs   &$rs   the recordset to serialize

[ Top ]

method ServerInfo [line 356]


method SetCharSet [line 1974]

void SetCharSet( $charset)



Overridden in child classes as:

ADODB_mysqli::SetCharSet()
ADODB_postgres7::SetCharSet()

Parameters:

   $charset  

[ Top ]

method SetDateLocale [line 2032]

void 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  

[ Top ]

method SetFetchMode [line 625]

The SetFetchMode( mode $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 :-)




Tags:

return:  previous fetch mode


Parameters:

mode   $mode   The fetchmode ADODB_FETCH_ASSOC or ADODB_FETCH_NUM

[ Top ]

method SetTransactionMode [line 2133]


method SQLDate [line 510]


method StartTrans [line 742]

void StartTrans( [ $errfn = 'ADODB_TransMonitor'])



Parameters:

   $errfn  

[ Top ]

method Time [line 400]

void Time( )



Overridden in child classes as:

ADODB_oci8::Time()
ADODB_access::Time()
ADODB_vfp::Time()
ADODB_pdo::Time()

[ Top ]

method Transpose [line 1376]

void &Transpose( &$rs, [ $addfieldnames = true])



Parameters:

   &$rs  
   $addfieldnames  

[ Top ]

method UnixDate [line 2478]

date UnixDate( $v $v)

Also in ADORecordSet.



Tags:

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


Overridden in child classes as:

ADODB_mssql::UnixDate()
ADODB_sybase::UnixDate()

Parameters:

$v   $v   is a date string in YYYY-MM-DD format

[ Top ]

method UnixTimeStamp [line 2502]

date UnixTimeStamp( $v $v)

Also in ADORecordSet.



Tags:

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


Overridden in child classes as:

ADODB_mssql::UnixTimeStamp()
ADODB_sybase::UnixTimeStamp()

Parameters:

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

[ Top ]

method UpdateBlob [line 1941]

void 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');




Overridden in child classes as:

ADODB_db2::UpdateBlob()
ADODB_ibase::UpdateBlob()
ADODB_informix72::UpdateBlob()
ADODB_mssql::UpdateBlob()
ADODB_oci8::UpdateBlob()
Usage: Store BLOBs and CLOBs
ADODB_odbc::UpdateBlob()
ADODB_sqlanywhere::UpdateBlob()
ADODB_odbtp::UpdateBlob()
ADODB_postgres64::UpdateBlob()

Parameters:

   $table  
   $column  
   $val  
   $where  
   $blobtype  

[ Top ]

method UpdateBlobFile [line 1955]

void 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');




Overridden in child classes as:

ADODB_ibase::UpdateBlobFile()
ADODB_oci8::UpdateBlobFile()
Usage: store file pointed to by $var in a blob
ADODB_postgres64::UpdateBlobFile()

Parameters:

   $table  
   $column  
   $path  
   $where  
   $blobtype  

[ Top ]

method UpdateClob [line 2009]

void 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  

[ Top ]

method UserDate [line 2532]

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

Also in ADORecordSet.

Format database date based on user defined format.




Tags:

return:  date formated as user desires


Parameters:

v   $v   is the character date in YYYY-MM-DD format, returned by database
fmt   $fmt   is the format to apply to it, using date()
   $gmt  

[ Top ]

method UserTimeStamp [line 2553]

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



Tags:

return:  timestamp formated as user desires


Parameters:

v   $v   is the character timestamp in YYYY-MM-DD hh:mm:ss format
fmt   $fmt   is the format to apply to it, using date()
   $gmt  

[ Top ]

method Version [line 343]

void Version( )



[ Top ]

method xCacheFlush [line 1631]

void xCacheFlush( [ $sql = false], [ $inputarr = false])



Parameters:

   $sql  
   $inputarr  

[ Top ]

method _dirFlush [line 1615]

void _dirFlush( $dir, [ $kill_top_level = false])

Private function to erase all of the files and subdirectories in a directory.

Just specify the directory, and tell it if you want to delete the directory or just clear it out. Note: $kill_top_level is used internally in the function to flush subdirectories.




Parameters:

   $dir  
   $kill_top_level  

[ Top ]

method _Execute [line 898]

void &_Execute( $sql, [ $inputarr = false])



Overridden in child classes as:

ADODB_csv::_Execute()
ADODB_ibase::_Execute()

Parameters:

   $sql  
   $inputarr  

[ Top ]

method _findschema [line 2285]

void _findschema( &$table, &$schema)



Parameters:

   &$table  
   &$schema  

[ Top ]

method _findvers [line 366]

void _findvers( $str)



Parameters:

   $str  

[ Top ]

method _gencachename [line 1684]

void _gencachename( $sql, $createdir, [ $memcache = false])

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  
   $memcache  

[ Top ]

method _nconnect [line 449]

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



Overridden in child classes as:

ADODB_mysql::_nconnect()
ADODB_mysqli::_nconnect()
ADODB_oci8::_nconnect()
ADODB_postgres64::_nconnect()

Parameters:

   $argHostname  
   $argUsername  
   $argPassword  
   $argDatabaseName  

[ Top ]

method _rs2rs [line 1221]

the &_rs2rs( rs &$rs, [[nrows] $nrows = -1], [[offset] $offset = -1], [ $close = true])

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



Tags:

return:  new recordset


Parameters:

rs   &$rs   the recordset to copy
[nrows]   $nrows   number of rows to retrieve (optional)
[offset]   $offset   offset by number of rows (optional)
   $close  

[ Top ]


Documentation generated on Fri, 18 Jul 2008 21:43:00 +0200 by phpDocumentor 1.4.1