TYPO3 CMS  TYPO3_7-6
TYPO3 CMS Documentation
Version
v5.20.3 01-Jan-2016

Released under both BSD license and Lesser GPL library license. You can choose which license you prefer.

PHP's database access functions are not standardised. This creates a need for a database class library to hide the differences between the different database API's (encapsulate the differences) so we can easily switch databases.

We currently support MySQL, Oracle, Microsoft SQL Server, Sybase, Sybase SQL Anywhere, DB2, Informix, PostgreSQL, FrontBase, Interbase (Firebird and Borland variants), Foxpro, Access, ADO, SAP DB, SQLite and ODBC. We have had successful reports of connecting to Progress and other databases via ODBC.

Latest Download at http://adodb.sourceforge.net/ Set ADODB_DIR to the directory where this file resides... This constant was formerly called $ADODB_RootPath

Fetch mode

Set global variable $ADODB_FETCH_MODE to one of these constants or use the SetFetchMode() method to control how recordset fields are returned when fetching data.

  • NUM: array()
  • ASSOC: array('id' => 456, 'name' => 'john')
  • BOTH: array(0 => 456, 'id' => 456, 1 => 'john', 'name' => 'john')
  • DEFAULT: driver-dependent

Associative array case constants

By defining the ADODB_ASSOC_CASE constant to one of these values, it is possible to control the case of field names (associative array's keys) when operating in ADODB_FETCH_ASSOC fetch mode.

  • LOWER: $rs->fields['orderid']
  • UPPER: $rs->fields['ORDERID']
  • NATIVE: $rs->fields['OrderID'] (or whatever the RDBMS will return)

The default is to use native case-names.

NOTE: This functionality is not implemented everywhere, it currently works only with: mssql, odbc, oci8 and ibase derived drivers

AutoExecute constants (moved from adodb-pear.inc.php since they are only used in here)

Accepts $src and $dest arrays, replacing string $data

ADODB version as a string.

Determines whether recordset->RecordCount() is used. Set to false for highest performance – RecordCount() will always return -1 then for databases that provide "virtual" recordcounts...

Helper class for FetchFields – holds info on a column

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.

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

RDBMS currently in use, eg. odbc, mysql, mssql

Name of database to be used.

The hostname of the database server

The username which is used to connect to the database server.

Password for the username. For security, we no longer store it.

if set to true will output sql statements

maximum size of blobs or large text fields (262144 = 256K)– some db's die otherwise like foxpro

default concat operator – change to || for Oracle/Interbase

substring operator

string length ofperator

random function

uppercase function

used by DBDate() as the default date format used by the database

used by DBTimeStamp as the default timestamp fmt.

string that represents TRUE for a database

string that represents FALSE for a database

string to use to replace quotes

string to use to quote identifiers and names

character set to use - only for interbase, postgres and oci8

All order by columns have to be unique

supports autoincrement ID?

supports affected rows for update/delete?

support mssql/access SELECT TOP 10 * FROM TABLE

support pgsql/mysql SELECT * FROM TABLE LIMIT 10

this is a readonly database - used by phpLens

has ability to run MoveFirst(), scrolling backwards

can generate sequences using GenID();

has transactions

sequence id used by GenID();

error function to call

accepts dates in ISO format

cache for 1 hour

should we use memCache instead of caching in files

memCache host

memCache port

Use 'true' to store the item compressed (uses zlib)

name of function that returns the current date

name of function that returns the current timestamp

name of class used to generate array recordsets, which are pre-downloaded recordsets

oracle specific stuff - if true ensures that '' is converted to ' '

indicates that all fields in order by must be unique

operator to use for left outer join in WHERE clause

operator to use for right outer join in WHERE clause

whether ansi outer join syntax supported

do not modify this yourself - actually private

temporarily disable transactions

count of nested transactions

The returned link identifier whenever a successful database connection is made.

A variable which was used to keep the returned last error message. The value will then returned by the errorMsg() function

Last error code, not guaranteed to be used - only by oci8

This variable keeps the last created result link identifier

A boolean variable to state whether its a persistent connection or normal connection. */

set to true if ADOConnection.Execute() permits binding of array parameters.

Adds a parameter to the connection string.

These parameters are added to the connection string when connecting, if the driver is coded to use it.

Parameters
string$parameterThe name of the parameter to set
string$valueThe value of the parameter
Returns
null

Get server version info...

Returns
An array with 2 elements: $arr['string'] is the description string, and $arr[version] is the version (also a string).

All error messages go through this bottleneck function. You can define your own handler by defining the function name in ADODB_OUTP.

Connect to database

Parameters
[argHostname]Host to connect to
[argUsername]Userid to login
[argPassword]Associated password
[argDatabaseName]database
[forceNew]force new connection
Returns
true or false

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

Parameters
[argHostname]Host to connect to
[argUsername]Userid to login
[argPassword]Associated password
[argDatabaseName]database
Returns
true or false

Establish persistent connect to database

Parameters
[argHostname]Host to connect to
[argUsername]Userid to login
[argPassword]Associated password
[argDatabaseName]database
Returns
return true or false

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
sqlSQL to send to database
Returns
return FALSE, or the prepared statement, or the original sql if if the database does not support prepare.

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
sqlSQL to send to database
Returns
return FALSE, or the prepared statement, or the original sql if if the database does not support prepare.

PEAR DB Compat

Requested by "Karsten Dambekalns" k.dam.nosp@m.beka.nosp@m.lns@f.nosp@m.ishf.nosp@m.arm.d.nosp@m.e

PEAR DB Compat - do not use internally.

PEAR DB Compat - do not use internally.

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
$tablename of table to lock
$wherewhere clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock

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
modeThe fetchmode ADODB_FETCH_ASSOC or ADODB_FETCH_NUM
Returns
The previous fetch mode

PEAR DB Compat - do not use internally.

PEAR DB Compat - do not use internally

PEAR DB Compat - do not use internally

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$nameparameter'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
    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.

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

if true, monitor sql errors and commit and rollback as appropriate, and if set to false force rollback even if no SQL error detected.

Returns
true on commit, false on rollback.

Check if transaction has failed, only for Smart Transactions.

Execute SQL

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

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

Parameters
seqnamename of sequence to use
startIDif sequence does not exist, start at this ID
Returns
0 if not supported, otherwise a sequence id
Parameters
$tablestring name of the table, not needed by all databases (eg. mysql), default ''
$columnstring name of the column, not needed by all databases (eg. mysql), default ''
Returns
the last inserted ID. Not all databases support this.

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

Returns
the last inserted ID. All databases support this. But aware possible problems in multiuser environments. Heavy test this before deploying.
# rows affected by UPDATE/DELETE
the last error message
the last error number. Normally 0 means no error.
an array with the primary key columns in it.
assoc array where keys are tables, and values are foreign keys

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

Parameters
dbNameis the name of the database to select
Returns
true or 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. 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
[offset]is the row to start calculations from (1-based)
[nrows]is the number of rows to get
[inputarr]array of bind variables
[secs2cache]is a private parameter only used by jlim
Returns
the recordset ($rs->databaseType == 'array')

Create serializable recordset. Breaks rs link to connection.

Parameters
rsthe recordset to serialize

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

Parameters
rsthe recordset to copy
[nrows]number of rows to retrieve (optional)
[offset]offset by number of rows (optional)
Returns
the new recordset

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

Parameters
sqlSQL statement
[inputarr]input bind array
sqlSQL statement
[inputarr]input bind array

Return one row of sql statement. Recordset is disposed for you. Note that SelectLimit should not be called.

Parameters
sqlSQL statement
[inputarr]input bind array

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

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]seconds to cache data, set to 0 to force query. This is optional
sql
[offset]is the row to start calculations from (1-based)
[nrows]is the number of rows to get
[inputarr]array of bind variables
Returns
the recordset ($rs->databaseType == 'array')

Flush cached recordsets that match a particular $sql statement. If $sql == false, then we purge all files in the cache.

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!

Execute SQL, caching recordsets.

Parameters
[secs2cache]seconds to cache data, set to 0 to force query. This is an optional parameter.
sqlSQL statement to execute
[inputarr]holds the input data to bind to
Returns
RecordSet or false

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" jyoun.nosp@m.ger@.nosp@m.unila.nosp@m.b.co.nosp@m.m

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.

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

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

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

Change the SQL connection locale to a specified locale. This is used to get the date formats written depending on the client locale.

GetActiveRecordsClass Performs an 'ALL' query

Parameters
mixed$classThis string represents the class of the current active record
mixed$tableTable used by the active record object
mixed$whereOrderByWhere, order, by clauses
mixed$bindarr
mixed$primkeyArr
array$extraQuery extras: limit, offset...
mixed$relationsAssociative array: table's foreign name, "hasMany", "belongsTo" public
Returns
void

Close Connection

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

Returns
true if succeeded or false if database does not support transactions

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

Parameters
$okset to false to rollback transaction, true to commit
Returns
true/false.

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

Returns
true/false.

return the databases that the driver can connect to. Some databases will return an empty array.

Returns
an array of database names.

List procedures or functions in an array.

Parameters
procedureNamePatterna procedure name pattern; must match the procedure name as it is stored in the database
cataloga catalog name; must match the catalog name as it is stored in the database;
schemaPatterna schema name pattern;
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 ) )

Parameters
ttypecan either be 'VIEW' or 'TABLE' or false. If false, both views and tables are returned. "VIEW" returns only views "TABLE" returns only tables
showSchemareturns the schema/user with the table name, eg. USER.TABLE
maskis the input mask - only supported by oci8 and postgresql
Returns
array of tables for current database.

List columns in a database as an array of ADOFieldObjects. See top of file for definition of object.

Parameters
$tabletable name to query
$normalizemakes table name case-insensitive (required by some databases) is optional database schema to use - not supported by all databases.
Returns
array of ADOFieldObjects for current table.

List indexes on a table as an array.

Parameters
tabletable name to query
primarytrue to only show primary keys. Not actually used for most databases
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 ) ) )

List columns names in a table as an array.

Parameters
tabletable name to query
Returns
array of column names for current table.

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

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

Parameters
da date in Unix date time format.
Returns
date string in database date format

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

Parameters
tsa timestamp in Unix date time format.
Returns
timestamp string in database timestamp format

Also in ADORecordSet.

Parameters
$vis 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

Also in ADORecordSet.

Parameters
$vis 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

Also in ADORecordSet.

Format database date based on user defined format.

Parameters
vis the character date in YYYY-MM-DD format, returned by database
fmtis the format to apply to it, using date()
Returns
a date formated as user desires
Parameters
vis the character timestamp in YYYY-MM-DD hh:mm:ss format
fmtis the format to apply to it, using date()
Returns
a timestamp formated as user desires

Quotes a string, without prefixing nor appending quotes.

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
sthe string to quote
[magic_quotes]if $s is GET/POST var, set to get_magic_quotes_gpc(). This undoes the stupidity of magic quotes for GPC.
Returns
quoted string to be sent back to database

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
nrowsis the number of rows per page to get
pageis the page number to get (1-based)
[inputarr]array of bind variables
[secs2cache]is a private parameter only used by jlim
Returns
the recordset ($rs->databaseType == 'array')

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

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
secs2cacheseconds to cache data, set to 0 to force query
sql
nrowsis the number of rows per page to get
pageis the page number to get (1-based)
[inputarr]array of bind variables
Returns
the recordset ($rs->databaseType == 'array')

Internal placeholder for record objects. Used by ADORecordSet->FetchObj().

Lightweight recordset when there are no records to be returned

RecordSet class that represents the dataset returned by the database. To keep memory overhead low, this class holds only the current row in memory. No prefetching of data is done, so the RecordCount() can return -1 ( which means recordcount not known).

public variables

holds the current row data

any varchar/char field this size or greater is treated as a blob in other words, we use a text area for editing.

indicates that seek is supported

sql text

Indicates that the current record position is after the last record in a Recordset object.

what to display when $time==0

what to display when $time==0

datetime in Unix format rs created – for cached recordsets

used by Fields() to hold array - should be private?

default fetch mode

the parent connection

private variables

number of rows, or -1

number of fields in recordset

This variable keeps the result link identifier.

This variable keeps the current row in the Recordset.

has recordset been closed

Init() should only be called once

Used by FetchObj

Used by FetchObj

Added by Iván Oliva to implement recordset pagination

Added by Iván Oliva to implement recordset pagination

Added by Iván Oliva to implement recordset pagination

Constructor

Parameters
queryIDthis is the queryID returned by ADOConnection->_query()

Generate a SELECT tag string from a recordset, and return the string. If the recordset has 2 cols, we treat the 1st col as the containing the text to display to the user, and 2nd col as the return value. Default strings are compared with the FIRST column.

Parameters
namename of SELECT tag
[defstr]the value to hilite. Use an array for multiple hilites for listbox.
[blank1stItem]true to leave the 1st item in list empty
[multiple]true for listbox, false for popup
[size]#rows to show for listbox. not used by popup
[selectAttr]additional attributes to defined for SELECT tag. useful for holding javascript onChange='...' handlers. &
[compareFields0]when we have 2 cols in recordset, we compare the defstr with column 0 (1st col) if this is true. This is not documented.
Returns
HTML

changes by glen..nosp@m.davi.nosp@m.es@cc.nosp@m.e.ac.nosp@m..nz to support multiple hilited items

Generate a SELECT tag string from a recordset, and return the string. If the recordset has 2 cols, we treat the 1st col as the containing the text to display to the user, and 2nd col as the return value. Default strings are compared with the SECOND column.

return recordset as a 2-dimensional array.

Parameters
[nRows]is the number of rows to return. -1 means every row.
Returns
an array indexed by the rows (0-based) from the recordset

return recordset as a 2-dimensional array. Helper function for ADOConnection->SelectLimit()

Parameters
offsetis the row to start calculations from (1-based)
[nrows]is the number of rows to return
Returns
an array indexed by the rows (0-based) from the recordset

Synonym for GetArray() for compatibility with ADO.

Parameters
[nRows]is the number of rows to return. -1 means every row.
Returns
an array indexed by the rows (0-based) from the recordset

return whole recordset as a 2-dimensional associative array if there are more than 2 columns. The first column is treated as the key and is not included in the array. If there is only 2 columns, it will return a 1 dimensional array of key-value pairs unless $force_array == true.

Parameters
[force_array]has only meaning if we have 2 data columns. If false, a 1 dimensional array is returned, otherwise a 2 dimensional array is returned. If this sounds confusing, read the source.
[first2cols]means if there are more than 2 cols, ignore the remaining cols and instead of returning array[col0] => array(remaining cols), return array[col0] => col1
Returns
an associative array indexed by the first column of the array, or false if the data has less than 2 cols.
Parameters
vis the character timestamp in YYYY-MM-DD hh:mm:ss format
fmtis the format to apply to it, using date()
Returns
a timestamp formated as user desires
Parameters
vis the character date in YYYY-MM-DD format, returned by database
fmtis the format to apply to it, using date()
Returns
a date formated as user desires
Parameters
$vis 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
Parameters
$vis 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

PEAR DB Compat - do not use internally

PEAR DB compat, number of rows

PEAR DB compat, number of cols

Fetch a row, returning false if no more rows. This is PEAR DB compat mode.

Returns
false or array containing the current record

Fetch a row, returning PEAR_Error if no more rows. This is PEAR DB compat mode.

Returns
DB_OK or error object

Move to the first row in the recordset. Many databases do NOT support this.

Returns
true or false

Move to the last row in the recordset.

Returns
true or false

Move to next record in the recordset.

Returns
true if there still rows available, or false if there are no more rows (EOF).

Random access to a specific row in the recordset. Some databases do not support access to previous rows in the databases (no scrolling backwards).

Parameters
rowNumberis the row to move to (0-based)
Returns
true if there still rows available, or false if there are no more rows (EOF).

Get the value of a field in the current row by column name. Will not work if ADODB_FETCH_MODE is set to ADODB_FETCH_NUM.

Parameters
colnameis the field to access
Returns
the value of $colname column

Defines the function to use for table fields case conversion depending on ADODB_ASSOC_CASE

Returns
string strtolower/strtoupper or false if no conversion needed

Builds the bind array associating keys to recordset fields

Parameters
int$upperCase for the array keys, defaults to uppercase (see ADODB_ASSOC_CASE_xxx constants)

Use associative array to get fields array for databases that do not support associative arrays. Submitted by Paolo S. Asioli paolo.asioli::libero.it

Parameters
int$upperCase for the array keys, defaults to uppercase (see ADODB_ASSOC_CASE_xxx constants)

Clean up recordset

Returns
true or false

synonyms RecordCount and RowCount

Returns
the number of rows or -1 if this is not supported

synonyms RecordCount and RowCount

Returns
the number of rows or -1 if this is not supported

Portable RecordCount. Pablo Roca pablo.nosp@m.roca.nosp@m.@mvps.nosp@m..org

Returns
the number of records from a previous SELECT. All databases support this.

But aware possible problems in multiuser environments. For better speed the table must be indexed by the condition. Heavy test this before deploying.

Returns
the current row in the recordset. If at EOF, will return the last row. 0-based.

synonym for CurrentRow – for ADO compat

Returns
the current row in the recordset. If at EOF, will return the last row. 0-based.
the number of columns in the recordset. Some databases will set this to 0 if no records are returned, others will return the number of columns in the query.

Get the ADOFieldObject of a specific column.

Parameters
fieldoffsetis the column position to access(0-based).
Returns
the ADOFieldObject for that column, or false.

Get the ADOFieldObjects of all columns in an array.

Return the fields array of the current row as an object for convenience. The default case is lowercase field names.

Returns
the object with the properties set to the fields of the current row

Return the fields array of the current row as an object for convenience. The default case is uppercase.

Parameters
$isupperto set the object property names to uppercase
Returns
the object with the properties set to the fields of the current row

Return the fields array of the current row as an object for convenience. The default is lower-case field names.

Returns
the object with the properties set to the fields of the current row, or false if EOF

Fixed bug reported by tim@o.nosp@m.rote.nosp@m.ch.ne.nosp@m.t

Return the fields array of the current row as an object for convenience. The default is upper case field names.

Parameters
$isupperto set the object property names to uppercase
Returns
the object with the properties set to the fields of the current row, or false if EOF

Fixed bug reported by tim@o.nosp@m.rote.nosp@m.ch.ne.nosp@m.t

Get the metatype of the column. This is used for formatting. This is because many databases use different names for the same type, so we transform the original type to our standardised version which uses 1 character codes:

Parameters
tis the type passed in. Normally is ADOFieldObject->type.
lenis the maximum length of that field. This is because we treat character fields bigger than a certain size as a 'B' (blob).
fieldobjis the field object returned by the database driver. Can hold additional info (eg. primary_key for mysql).
Returns
the general type of the data: C for character < 250 chars X for teXt (>= 250 chars) B for Binary N for numeric or floating point D for date T for timestamp L for logical/Boolean I for integer R for autoincrement counter/integer

Convert case of field names associative array, if needed

Returns
void

set/returns the current recordset page when paginating

set/returns the status of the atFirstPage flag when paginating

set/returns the status of the atLastPage flag when paginating

This class encapsulates the concept of a recordset created in memory as an array. This is useful for the creation of cached recordsets.

Note that the constructor is different from the standard ADORecordSet

Constructor

Setup the array.

Parameters
arrayis a 2-dimensional array holding the data. The first row should hold the column names unless paramter $colnames is used.
typearrholds an array of types. These are the same types used in MetaTypes (C,B,L,I,N).
[colnames]array of column names. If set, then the first row of $array should not hold the column names.

Setup the Array and datatype file objects

Parameters
arrayis a 2-dimensional array holding the data. The first row should hold the column names unless paramter $colnames is used.
fieldarrholds an array of ADOFieldObject's.

Synonym for ADOLoadCode. Private function. Do not use.

Deprecated:

Load the code for a specific database driver. Private function. Do not use.

synonym for ADONewConnection for people like me who cannot remember the correct name

Instantiate a new Connection class for a specific database driver.

Parameters
[db]is the database Connection object to create. If undefined, use the last database driver that was loaded by ADOLoadCode().
Returns
the freshly created instance of the Connection class.