ADOConnectionConnection object. For connecting to databases, and executing queries.
Located in /3rd/adodb/adodb.inc.php (line 233)
| Class | Description |
|---|---|
|
Connection object. For connecting to databases, and executing queries. |
ADODB_csv
|
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. |
void
&AutoExecute
( $table, $fields_values, [ $mode = 'INSERT'], [ $where = FALSE], [ $forceUpdate = true], [ $magicq = false])
RecordSet
&CacheExecute
([secs2cache] $secs2cache, [sql $sql = false], [[inputarr] $inputarr = false])
void
&CacheGetAssoc
( $secs2cache, [ $sql = false], [ $inputarr = false], [ $force_array = false], [ $first2cols = false])
the
&CachePageExecute
(secs2cache $secs2cache, sql $sql, nrows $nrows, page $page, [[inputarr] $inputarr = false])
the
&CacheSelectLimit
([secs2cache] $secs2cache, sql $sql, [[offset] $nrows = -1], [[nrows] $offset = -1], [[inputarr] $inputarr = false])
true
Connect
([[argHostname] $argHostname = ""], [[argUsername] $argUsername = ""], [[argPassword] $argPassword = ""], [[argDatabaseName] $argDatabaseName = ""], [[forceNew] $forceNew = false])
void
GetUpdateSQL
( &$rs, $arrFields, [ $forceUpdate = false], [ $magicq = false], [ $force = null])
true
NConnect
([[argHostname] $argHostname = ""], [[argUsername] $argUsername = ""], [[argPassword] $argPassword = ""], [[argDatabaseName] $argDatabaseName = ""])
the
&PageExecute
(sql $sql, nrows $nrows, page $page, [[inputarr] $inputarr = false], [[secs2cache] $secs2cache = 0])
return
PConnect
([[argHostname] $argHostname = ""], [[argUsername] $argUsername = ""], [[argPassword] $argPassword = ""], [[argDatabaseName] $argDatabaseName = ""])
the
&SelectLimit
(sql $sql, [[offset] $nrows = -1], [[nrows] $offset = -1], [[inputarr] $inputarr = false], [[secs2cache] $secs2cache = 0])
mixed
$ansiOuter
= false (line 288)
mixed
$arrayClass
= 'ADORecordSet_array' (line 279)
mixed
$autoCommit
= true (line 297)
mixed
$autoRollback
= false (line 289)
mixed
$blobEncodeType
= false (line 294)
mixed
$cacheSecs
= 3600 (line 276)
mixed
$concat_operator
= '+' (line 245)
mixed
$database
= '' (line 239)
mixed
$databaseType
= '' (line 238)
mixed
$dataProvider
= 'native' (line 237)
mixed
$debug
= false (line 243)
mixed
$emptyDate
= ' ' (line 260)
mixed
$emptyTimeStamp
= ' ' (line 261)
mixed
$false
= '0' (line 253)
mixed
$fetchMode
= false (line 301)
mixed
$fmtDate
= "'Y-m-d'" (line 250)
mixed
$fmtTimeStamp
= "'Y-m-d, h:i:s A'" (line 251)
mixed
$fnCacheExecute
= false (line 293)
mixed
$fnExecute
= false (line 292)
mixed
$genID
= 0 (line 273)
mixed
$hasAffectedRows
= false (line 265)
mixed
$hasGenID
= false (line 270)
mixed
$hasInsertID
= false (line 264)
mixed
$hasLimit
= false (line 267)
mixed
$hasMoveFirst
= false (line 269)
mixed
$hasTop
= false (line 266)
mixed
$hasTransactions
= true (line 271)
mixed
$host
= '' (line 240)
mixed
$isoDates
= false (line 275)
mixed
$lastInsID
= false (line 262)
mixed
$leftOuter
= false (line 286)
mixed
$length
= 'length' (line 247)
mixed
$maxblobsize
= 262144 (line 244)
mixed
$metaDatabasesSQL
= '' (line 257)
mixed
$metaTablesSQL
= '' (line 258)
mixed
$nameQuote
= '"' (line 255)
mixed
$numCacheHits
= 0 (line 282)
mixed
$numCacheMisses
= 0 (line 283)
mixed
$pageExecuteCountRows
= true (line 284)
mixed
$poorAffectedRows
= false (line 290)
mixed
$raiseErrorFn
= false (line 274)
mixed
$random
= 'rand()' (line 248)
mixed
$readOnly
= false (line 268)
mixed
$replaceQuote
= "\\'" (line 254)
mixed
$rightOuter
= false (line 287)
mixed
$rsPrefix
= "ADORecordSet_" (line 295)
mixed
$substr
= 'substr' (line 246)
mixed
$sysDate
= false (line 277)
mixed
$sysTimeStamp
= false (line 278)
mixed
$transCnt
= 0 (line 299)
mixed
$transOff
= 0 (line 298)
mixed
$true
= '1' (line 252)
mixed
$upperCase
= 'upper' (line 249)
mixed
$user
= '' (line 241)
mixed
$_affected
= false (line 316)
mixed
$_bindInputArray
= false (line 314)
mixed
$_connectionID
= false (line 307)
mixed
$_errorCode
= false (line 310)
mixed
$_errorMsg
= false (line 308)
mixed
$_evalAll
= false (line 315)
mixed
$_isPersistentConnection
= false (line 313)
mixed
$_logsql
= false (line 317)
mixed
$_oldRaiseFn
= false (line 305)
mixed
$_queryID
= false (line 311)
mixed
$_transOK
= null (line 306)
Constructor ADOConnection (line 324)
Constructor
addq (line 2288)
Quotes a string, without prefixing nor appending quotes.
Affected_Rows (line 995)
AutoExecute (line 1672)
BeginTrans (line 1918)
Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().
BlobDecode (line 1799)
BlobEncode (line 1804)
CacheExecute (line 1581)
Execute SQL, caching recordsets.
CacheFlush (line 1502)
Flush cached recordsets that match a particular $sql statement.
If $sql == false, then we purge all files in the cache.
CacheGetAll (line 1371)
CacheGetArray (line 1376)
CacheGetAssoc (line 1240)
CacheGetCol (line 1312)
CacheGetOne (line 1278)
CacheGetRow (line 1424)
CachePageExecute (line 2385)
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.
CacheSelectLimit (line 1484)
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
Close (line 1906)
Close Connection
CommitLock (line 591)
CommitTrans (line 1928)
If database does not support transactions, always return true as data always commited
CompleteTrans (line 738)
Concat (line 2137)
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);
Connect (line 405)
Connect to database
CreateSequence (line 912)
DBDate (line 2151)
Converts a date "d" to a string that the database can understand.
DBTimeStamp (line 2172)
Converts a timestamp "ts" to a string that the database can understand.
Disconnect (line 648)
PEAR DB Compat - do not use internally
DropSequence (line 918)
ErrorMsg (line 1013)
ErrorNative (line 565)
PEAR DB Compat - do not use internally.
ErrorNo (line 1023)
escape (line 2280)
Execute (line 793)
Execute SQL
FailTrans (line 765)
GenID (line 932)
Generates a sequence id and stores it in $this->genID; GenID is only available if $this->hasGenID = true;
GetAll (line 1223)
GetArray (line 1352)
GetAssoc (line 1229)
GetCharSet (line 1832)
GetCol (line 1290)
GetInsertSQL (line 1744)
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.
GetOne (line 1262)
Return first element of first row of sql statement. Recordset is disposed for you.
GetRow (line 1404)
Return one row of sql statement. Recordset is disposed for you.
GetUpdateSQL (line 1716)
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>
HasFailedTrans (line 780)
IfNull (line 1814)
InParameter (line 670)
Insert_ID (line 965)
IsConnected (line 347)
LimitQuery (line 637)
PEAR DB Compat - do not use internally
LogSQL (line 1819)
MetaColumnNames (line 2110)
List columns names in a table as an array.
MetaColumns (line 2039)
List columns in a database as an array of ADOFieldObjects.
See top of file for definition of object.
MetaDatabases (line 1947)
return the databases that the driver can connect to.
Some databases will return an empty array.
MetaError (line 1028)
MetaErrorMsg (line 1035)
MetaForeignKeys (line 1064)
MetaIndexes (line 2098)
List indexes on a table as an array.
MetaPrimaryKeys (line 1044)
MetaTables (line 1977)
MetaType (line 1851)
NConnect (line 451)
Always force a new connection to database - currently only works with oracle
nextId (line 574)
PEAR DB Compat - do not use internally.
OffsetDate (line 1340)
outp (line 362)
All error messages go through this bottleneck function.
You can define your own handler by defining the function name in ADODB_OUTP.
OutParameter (line 677)
PageExecute (line 2363)
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.
Param (line 662)
Parameter (line 698)
PConnect (line 466)
Establish persistent connect to database
PO_Insert_ID (line 983)
Portable Insert ID. Pablo Roca <pabloroca#mvps.org>
Prepare (line 517)
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');
PrepareSP (line 536)
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:
q (line 557)
QMagic (line 552)
qstr (line 2322)
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());
Query (line 626)
PEAR DB Compat - do not use internally.
Quote (line 544)
PEAR DB Compat
Replace (line 1457)
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
RollbackLock (line 596)
RollbackTrans (line 1937)
If database does not support transactions, rollbacks always fail, so return false
RowLock (line 586)
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
SelectDB (line 1074)
Choose a database to connect to. Many databases do not support this.
SelectLimit (line 1097)
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
SerializableRS (line 1165)
Create serializable recordset. Breaks rs link to connection.
ServerInfo (line 342)
SetCharSet (line 1809)
SetDateLocale (line 1867)
Change the SQL connection locale to a specified locale.
This is used to get the date formats written depending on the client locale.
SetFetchMode (line 610)
PEAR DB Compat - do not use internally.
The fetch modes for NUMERIC and ASSOC for PEAR DB and ADODB are identical for easy porting :-)
SQLDate (line 496)
StartTrans (line 713)
Time (line 386)
UnixDate (line 2193)
Also in ADORecordSet.
UnixTimeStamp (line 2217)
Also in ADORecordSet.
UpdateBlob (line 1776)
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');
UpdateBlobFile (line 1790)
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');
UpdateClob (line 1844)
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');
UserDate (line 2247)
Also in ADORecordSet.
Format database date based on user defined format.
UserTimeStamp (line 2268)
Version (line 329)
_Execute (line 862)
_findschema (line 2021)
_findvers (line 352)
_gencachename (line 1546)
Private function to generate filename for caching.
Filename is generated based on:
_nconnect (line 435)
_rs2rs (line 1184)
Convert database recordset to an array recordset input recordset's cursor should be at beginning, and old $rs will be closed.
Documentation generated on Wed, 23 Jan 2008 19:34:31 -0500 by phpDocumentor 1.4.0