[ PHPXref.com ] [ Generated: Sun Jul 20 18:34:02 2008 ] [ MDPro 1.0.76 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/pnadodb/ -> adodb.inc.php (summary)

(no description)

File Size: 3824 lines (113 kb)
Included or required: 5 times
Referenced: 0 times
Includes or requires: 8 files
 pnadodb/adodb-iterator.inc.php
 pnadodb/adodb-csvlib.inc.php
 pnadodb/adodb-time.inc.php
 pnadodb/adodb-error.inc.php
 pnadodb/adodb-lib.inc.php
 pnadodb/adodb-perf.inc.php
 pnadodb/adodb-php4.inc.php
 pnadodb/adodb-datadict.inc.php

Defines 6 classes

ADOFieldObject:: (1 method):
  ADODB_TransMonitor()

ADOConnection:: (104 methods):
  ADOConnection()
  Version()
  ServerInfo()
  IsConnected()
  _findvers()
  outp()
  Time()
  Connect()
  _nconnect()
  NConnect()
  PConnect()
  SQLDate()
  Prepare()
  PrepareSP()
  Quote()
  QMagic()
  q()
  ErrorNative()
  nextId()
  RowLock()
  CommitLock()
  RollbackLock()
  SetFetchMode()
  Query()
  LimitQuery()
  Disconnect()
  Param()
  InParameter()
  OutParameter()
  Parameter()
  StartTrans()
  CompleteTrans()
  FailTrans()
  HasFailedTrans()
  Execute()
  _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()
  CacheGetOne()
  GetCol()
  CacheGetCol()
  OffsetDate()
  GetArray()
  CacheGetAll()
  CacheGetArray()
  GetRow()
  CacheGetRow()
  Replace()
  CacheSelectLimit()
  CacheFlush()
  _gencachename()
  CacheExecute()
  AutoExecute()
  GetUpdateSQL()
  GetInsertSQL()
  UpdateBlob()
  UpdateBlobFile()
  BlobDecode()
  BlobEncode()
  SetCharSet()
  IfNull()
  LogSQL()
  GetCharSet()
  UpdateClob()
  SetDateLocale()
  Close()
  BeginTrans()
  CommitTrans()
  RollbackTrans()
  MetaDatabases()
  MetaTables()
  _findschema()
  MetaColumns()
  MetaIndexes()
  MetaColumnNames()
  Concat()
  DBDate()
  DBTimeStamp()
  UnixDate()
  UnixTimeStamp()
  UserDate()
  UserTimeStamp()
  addq()
  qstr()
  PageExecute()
  CachePageExecute()

ADOFetchObj:: (0 methods):

ADORecordSet_empty:: (7 methods):
  RowCount()
  RecordCount()
  PO_RecordCount()
  Close()
  FetchRow()
  FieldCount()
  Init()

ADORecordSet:: (45 methods):
  ADORecordSet()
  Init()
  GetMenu()
  GetMenu2()
  GetArray()
  GetAll()
  NextRecordSet()
  GetArrayLimit()
  GetRows()
  GetAssoc()
  UserTimeStamp()
  UserDate()
  UnixDate()
  UnixTimeStamp()
  Free()
  NumRows()
  NumCols()
  FetchRow()
  FetchInto()
  MoveFirst()
  MoveLast()
  MoveNext()
  Move()
  Fields()
  GetAssocKeys()
  GetRowAssoc()
  Close()
  RecordCount()
  MaxRecordCount()
  RowCount()
  PO_RecordCount()
  CurrentRow()
  AbsolutePosition()
  FieldCount()
  FetchField()
  FetchObj()
  FetchObject()
  FetchNextObj()
  FetchNextObject()
  MetaType()
  _close()
  AbsolutePage()
  AtFirstPage()
  LastPageNo()
  AtLastPage()

ADORecordSet_array:: (20 methods):
  ADORecordSet_array()
  InitArray()
  InitArrayFields()
  GetArray()
  _initrs()
  Fields()
  FetchField()
  _seek()
  MoveNext()
  _fetch()
  _close()
  ADOLoadDB()
  ADOLoadCode()
  NewADOConnection()
  ADONewConnection()
  _adodb_getdriver()
  NewPerfMonitor()
  NewDataDictionary()
  adodb_pr()
  adodb_backtrace()

Defines 20 functions

  ADODB_str_replace()
  ADODB_Setup()

Class: ADOFieldObject  - X-Ref

Helper class for FetchFields -- holds info on a column

Class: ADOConnection  - X-Ref

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

ADOConnection()   X-Ref
Constructor


Version()   X-Ref
No description

ServerInfo()   X-Ref
No description

IsConnected()   X-Ref
No description

_findvers($str)   X-Ref
No description

outp($msg,$newline=true)   X-Ref
All error messages go through this bottleneck function.
You can define your own handler by defining the function name in ADODB_OUTP.


Time()   X-Ref
No description

Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false)   X-Ref
Connect to database

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

_nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName)   X-Ref
No description

NConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "")   X-Ref
Always force a new connection to database - currently only works with oracle

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

PConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "")   X-Ref
Establish persistent connect to database

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

SQLDate($fmt, $col=false)   X-Ref
No description

Prepare($sql)   X-Ref
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');

param: sql    SQL to send to database
return: return FALSE, or the prepared statement, or the original sql if

PrepareSP($sql,$param=true)   X-Ref
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:

param: sql    SQL to send to database
return: return FALSE, or the prepared statement, or the original sql if

Quote($s)   X-Ref
PEAR DB Compat


QMagic($s)   X-Ref
No description

q(&$s)   X-Ref
No description

ErrorNative()   X-Ref
PEAR DB Compat - do not use internally.


nextId($seq_name)   X-Ref
PEAR DB Compat - do not use internally.


RowLock($table,$where)   X-Ref
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

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

CommitLock($table)   X-Ref
No description

RollbackLock($table)   X-Ref
No description

SetFetchMode($mode)   X-Ref
PEAR DB Compat - do not use internally.

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

returns: The previous fetch mode
param: mode    The fetchmode ADODB_FETCH_ASSOC or ADODB_FETCH_NUM

Query($sql, $inputarr=false)   X-Ref
PEAR DB Compat - do not use internally.


LimitQuery($sql, $offset, $count, $params=false)   X-Ref
PEAR DB Compat - do not use internally


Disconnect()   X-Ref
PEAR DB Compat - do not use internally


Param($name,$type='C')   X-Ref
No description

InParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false)   X-Ref
No description

OutParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false)   X-Ref
No description

Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false)   X-Ref
No description

StartTrans($errfn = 'ADODB_TransMonitor')   X-Ref
No description

CompleteTrans($autoComplete = true)   X-Ref
No description

FailTrans()   X-Ref
No description

HasFailedTrans()   X-Ref
No description

Execute($sql,$inputarr=false)   X-Ref
Execute SQL

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

_Execute($sql,$inputarr=false)   X-Ref
No description

CreateSequence($seqname='adodbseq',$startID=1)   X-Ref
No description

DropSequence($seqname='adodbseq')   X-Ref
No description

GenID($seqname='adodbseq',$startID=1)   X-Ref
Generates a sequence id and stores it in $this->genID;
GenID is only available if $this->hasGenID = true;

param: seqname        name of sequence to use
param: startID        if sequence does not exist, start at this ID
return: 0 if not supported, otherwise a sequence id

Insert_ID($table='',$column='')   X-Ref

param: $table string name of the table, not needed by all databases (eg. mysql), default ''
param: $column string name of the column, not needed by all databases (eg. mysql), default ''
return: the last inserted ID. Not all databases support this.

PO_Insert_ID($table="", $id="")   X-Ref
Portable Insert ID. Pablo Roca <pabloroca#mvps.org>

return: the last inserted ID. All databases support this. But aware possible

Affected_Rows()   X-Ref

return: # rows affected by UPDATE/DELETE

ErrorMsg()   X-Ref

return: the last error message

ErrorNo()   X-Ref

return: the last error number. Normally 0 means no error.

MetaError($err=false)   X-Ref
No description

MetaErrorMsg($errno)   X-Ref
No description

MetaPrimaryKeys($table, $owner=false)   X-Ref

returns: an array with the primary key columns in it.

MetaForeignKeys($table, $owner=false, $upper=false)   X-Ref

returns: assoc array where keys are tables, and values are foreign keys

SelectDB($dbName)   X-Ref
Choose a database to connect to. Many databases do not support this.

param: dbName     is the name of the database to select
return: true or false

SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)   X-Ref
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

param: sql
param: [offset]    is the row to start calculations from (1-based)
param: [nrows]        is the number of rows to get
param: [inputarr]    array of bind variables
param: [secs2cache]        is a private parameter only used by jlim
return: the recordset ($rs->databaseType == 'array')

SerializableRS(&$rs)   X-Ref
Create serializable recordset. Breaks rs link to connection.

param: rs            the recordset to serialize

_rs2rs(&$rs,$nrows=-1,$offset=-1,$close=true)   X-Ref
Convert database recordset to an array recordset
input recordset's cursor should be at beginning, and
old $rs will be closed.

param: rs            the recordset to copy
param: [nrows]      number of rows to retrieve (optional)
param: [offset]     offset by number of rows (optional)
return: the new recordset

GetAll($sql, $inputarr=false)   X-Ref
No description

GetAssoc($sql, $inputarr=false,$force_array = false, $first2cols = false)   X-Ref
No description

CacheGetAssoc($secs2cache, $sql=false, $inputarr=false,$force_array = false, $first2cols = false)   X-Ref
No description

GetOne($sql,$inputarr=false)   X-Ref
Return first element of first row of sql statement. Recordset is disposed
for you.

param: sql            SQL statement
param: [inputarr]        input bind array

CacheGetOne($secs2cache,$sql=false,$inputarr=false)   X-Ref
No description

GetCol($sql, $inputarr = false, $trim = false)   X-Ref
No description

CacheGetCol($secs, $sql = false, $inputarr = false,$trim=false)   X-Ref
No description

OffsetDate($dayFraction,$date=false)   X-Ref
No description

GetArray($sql,$inputarr=false)   X-Ref

param: sql            SQL statement
param: [inputarr]        input bind array

CacheGetAll($secs2cache,$sql=false,$inputarr=false)   X-Ref
No description

CacheGetArray($secs2cache,$sql=false,$inputarr=false)   X-Ref
No description

GetRow($sql,$inputarr=false)   X-Ref
Return one row of sql statement. Recordset is disposed for you.

param: sql            SQL statement
param: [inputarr]        input bind array

CacheGetRow($secs2cache,$sql=false,$inputarr=false)   X-Ref
No description

Replace($table, $fieldArray, $keyCol, $autoQuote=false, $has_autoinc=false)   X-Ref
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

CacheSelectLimit($secs2cache,$sql,$nrows=-1,$offset=-1,$inputarr=false)   X-Ref
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

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

CacheFlush($sql=false,$inputarr=false)   X-Ref
Flush cached recordsets that match a particular $sql statement.
If $sql == false, then we purge all files in the cache.


_gencachename($sql,$createdir)   X-Ref
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!

CacheExecute($secs2cache,$sql=false,$inputarr=false)   X-Ref
Execute SQL, caching recordsets.

param: [secs2cache]    seconds to cache data, set to 0 to force query.
param: sql        SQL statement to execute
param: [inputarr]    holds the input data  to bind to
return: RecordSet or false

AutoExecute($table, $fields_values, $mode = 'INSERT', $where = FALSE, $forceUpdate=true, $magicq=false)   X-Ref
No description

GetUpdateSQL(&$rs, $arrFields,$forceUpdate=false,$magicq=false,$force=null)   X-Ref
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>

GetInsertSQL(&$rs, $arrFields,$magicq=false,$force=null)   X-Ref
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.

UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')   X-Ref
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($table,$column,$path,$where,$blobtype='BLOB')   X-Ref
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');

BlobDecode($blob)   X-Ref
No description

BlobEncode($blob)   X-Ref
No description

SetCharSet($charset)   X-Ref
No description

IfNull( $field, $ifNull )   X-Ref
No description

LogSQL($enable=true)   X-Ref
No description

GetCharSet()   X-Ref
No description

UpdateClob($table,$column,$val,$where)   X-Ref
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');

SetDateLocale($locale = 'En')   X-Ref
Change the SQL connection locale to a specified locale.
This is used to get the date formats written depending on the client locale.


Close()   X-Ref
Close Connection


BeginTrans()   X-Ref
Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().

return: true if succeeded or false if database does not support transactions

CommitTrans($ok=true)   X-Ref
If database does not support transactions, always return true as data always commited

param: $ok  set to false to rollback transaction, true to commit
return: true/false.

RollbackTrans()   X-Ref
If database does not support transactions, rollbacks always fail, so return false

return: true/false.

MetaDatabases()   X-Ref
return the databases that the driver can connect to.
Some databases will return an empty array.

return: an array of database names.

MetaTables($ttype=false,$showSchema=false,$mask=false)   X-Ref

param: ttype can either be 'VIEW' or 'TABLE' or false.
param: showSchema returns the schema/user with the table name, eg. USER.TABLE
param: mask  is the input mask - only supported by oci8 and postgresql
return: array of tables for current database.

_findschema(&$table,&$schema)   X-Ref
No description

MetaColumns($table,$upper=true)   X-Ref
List columns in a database as an array of ADOFieldObjects.
See top of file for definition of object.

param: table    table name to query
param: upper    uppercase table name (required by some databases)
return: array of ADOFieldObjects for current table.

MetaIndexes($table, $primary = false, $owner = false)   X-Ref
List indexes on a table as an array.

param: table  table name to query
param: primary true to only show primary keys. Not actually used for most databases
return: array of indexes on current table. Each element represents an index, and is itself an associative array.

MetaColumnNames($table, $numIndexes=false)   X-Ref
List columns names in a table as an array.

param: table    table name to query
return: array of column names for current table.

Concat()   X-Ref
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);

return: concatenated string

DBDate($d)   X-Ref
Converts a date "d" to a string that the database can understand.

param: d    a date in Unix date time format.
return: date string in database date format

DBTimeStamp($ts)   X-Ref
Converts a timestamp "ts" to a string that the database can understand.

param: ts    a timestamp in Unix date time format.
return: timestamp string in database timestamp format

UnixDate($v)   X-Ref
Also in ADORecordSet.

param: $v is a date string in YYYY-MM-DD format
return: date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

UnixTimeStamp($v)   X-Ref
Also in ADORecordSet.

param: $v is a timestamp string in YYYY-MM-DD HH-NN-SS format
return: date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

UserDate($v,$fmt='Y-m-d',$gmt=false)   X-Ref
Also in ADORecordSet.

Format database date based on user defined format.

param: v      is the character date in YYYY-MM-DD format, returned by database
param: fmt     is the format to apply to it, using date()
return: a date formated as user desires

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

param: v      is the character timestamp in YYYY-MM-DD hh:mm:ss format
param: fmt     is the format to apply to it, using date()
return: a timestamp formated as user desires

addq($s,$magic_quotes=false)   X-Ref
Quotes a string, without prefixing nor appending quotes.


qstr($s,$magic_quotes=false)   X-Ref
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());

param: s            the string to quote
param: [magic_quotes]    if $s is GET/POST var, set to get_magic_quotes_gpc().
return: quoted string to be sent back to database

PageExecute($sql, $nrows, $page, $inputarr=false, $secs2cache=0)   X-Ref
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: sql
param: nrows        is the number of rows per page to get
param: page        is the page number to get (1-based)
param: [inputarr]    array of bind variables
param: [secs2cache]        is a private parameter only used by jlim
return: the recordset ($rs->databaseType == 'array')

CachePageExecute($secs2cache, $sql, $nrows, $page,$inputarr=false)   X-Ref
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.

param: secs2cache    seconds to cache data, set to 0 to force query
param: sql
param: nrows        is the number of rows per page to get
param: page        is the page number to get (1-based)
param: [inputarr]    array of bind variables
return: the recordset ($rs->databaseType == 'array')

Class: ADOFetchObj  - X-Ref

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

Class: ADORecordSet_empty  - X-Ref

Lightweight recordset when there are no records to be returned

RowCount()   X-Ref
No description

RecordCount()   X-Ref
No description

PO_RecordCount()   X-Ref
No description

Close()   X-Ref
No description

FetchRow()   X-Ref
No description

FieldCount()   X-Ref
No description

Init()   X-Ref
No description

Class: ADORecordSet  - X-Ref

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

ADORecordSet($queryID)   X-Ref
Constructor

param: queryID      this is the queryID returned by ADOConnection->_query()

Init()   X-Ref
No description

GetMenu($name,$defstr='',$blank1stItem=true,$multiple=false, $size=0, $selectAttr='',$compareFields0=true)   X-Ref
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.

param: name          name of SELECT tag
param: [defstr]        the value to hilite. Use an array for multiple hilites for listbox.
param: [blank1stItem]    true to leave the 1st item in list empty
param: [multiple]        true for listbox, false for popup
param: [size]        #rows to show for listbox. not used by popup
param: [selectAttr]        additional attributes to defined for SELECT tag.
return: HTML

GetMenu2($name,$defstr='',$blank1stItem=true,$multiple=false,$size=0, $selectAttr='')   X-Ref
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.


GetArray($nRows = -1)   X-Ref
return recordset as a 2-dimensional array.

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

GetAll($nRows = -1)   X-Ref
No description

NextRecordSet()   X-Ref
No description

GetArrayLimit($nrows,$offset=-1)   X-Ref
return recordset as a 2-dimensional array.
Helper function for ADOConnection->SelectLimit()

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

GetRows($nRows = -1)   X-Ref
Synonym for GetArray() for compatibility with ADO.

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

GetAssoc($force_array = false, $first2cols = false)   X-Ref
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.

param: [force_array] has only meaning if we have 2 data columns. If false, a 1 dimensional
param: [first2cols] means if there are more than 2 cols, ignore the remaining cols and
return: an associative array indexed by the first column of the array,

UserTimeStamp($v,$fmt='Y-m-d H:i:s')   X-Ref

param: v      is the character timestamp in YYYY-MM-DD hh:mm:ss format
param: fmt     is the format to apply to it, using date()
return: a timestamp formated as user desires

UserDate($v,$fmt='Y-m-d')   X-Ref

param: v      is the character date in YYYY-MM-DD format, returned by database
param: fmt     is the format to apply to it, using date()
return: a date formated as user desires

UnixDate($v)   X-Ref

param: $v is a date string in YYYY-MM-DD format
return: date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

UnixTimeStamp($v)   X-Ref

param: $v is a timestamp string in YYYY-MM-DD HH-NN-SS format
return: date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format

Free()   X-Ref
PEAR DB Compat - do not use internally


NumRows()   X-Ref
PEAR DB compat, number of rows


NumCols()   X-Ref
PEAR DB compat, number of cols


FetchRow()   X-Ref
Fetch a row, returning false if no more rows.
This is PEAR DB compat mode.

return: false or array containing the current record

FetchInto(&$arr)   X-Ref
Fetch a row, returning PEAR_Error if no more rows.
This is PEAR DB compat mode.

return: DB_OK or error object

MoveFirst()   X-Ref
Move to the first row in the recordset. Many databases do NOT support this.

return: true or false

MoveLast()   X-Ref
Move to the last row in the recordset.

return: true or false

MoveNext()   X-Ref
Move to next record in the recordset.

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

Move($rowNumber = 0)   X-Ref
Random access to a specific row in the recordset. Some databases do not support
access to previous rows in the databases (no scrolling backwards).

param: rowNumber is the row to move to (0-based)
return: true if there still rows available, or false if there are no more rows (EOF).

Fields($colname)   X-Ref
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.

param: colname  is the field to access
return: the value of $colname column

GetAssocKeys($upper=true)   X-Ref
No description

GetRowAssoc($upper=1)   X-Ref
Use associative array to get fields array for databases that do not support
associative arrays. Submitted by Paolo S. Asioli paolo.asioli#libero.it

If you don't want uppercase cols, set $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC
before you execute your SQL statement, and access $rs->fields['col'] directly.

$upper  0 = lowercase, 1 = uppercase, 2 = whatever is returned by FetchField

Close()   X-Ref
Clean up recordset

return: true or false

RecordCount()   X-Ref
synonyms RecordCount and RowCount

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

MaxRecordCount()   X-Ref
No description

RowCount()   X-Ref
synonyms RecordCount and RowCount

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

PO_RecordCount($table="", $condition="")   X-Ref
Portable RecordCount. Pablo Roca <pabloroca@mvps.org>

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

CurrentRow()   X-Ref

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

AbsolutePosition()   X-Ref
synonym for CurrentRow -- for ADO compat

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

FieldCount()   X-Ref

return: the number of columns in the recordset. Some databases will set this to 0

FetchField($fieldoffset)   X-Ref
Get the ADOFieldObject of a specific column.

param: fieldoffset    is the column position to access(0-based).
return: the ADOFieldObject for that column, or false.

FetchObj()   X-Ref
No description

FetchObject($isupper=true)   X-Ref
Return the fields array of the current row as an object for convenience.
The default case is uppercase.

param: $isupper to set the object property names to uppercase
return: the object with the properties set to the fields of the current row

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

return: the object with the properties set to the fields of the current row,

FetchNextObject($isupper=true)   X-Ref
Return the fields array of the current row as an object for convenience.
The default is upper case field names.

param: $isupper to set the object property names to uppercase
return: the object with the properties set to the fields of the current row,

MetaType($t,$len=-1,$fieldobj=false)   X-Ref
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:

param: t  is the type passed in. Normally is ADOFieldObject->type.
param: len is the maximum length of that field. This is because we treat character
param: fieldobj is the field object returned by the database driver. Can hold
return: the general type of the data:

_close()   X-Ref
No description

AbsolutePage($page=-1)   X-Ref
set/returns the current recordset page when paginating


AtFirstPage($status=false)   X-Ref
set/returns the status of the atFirstPage flag when paginating


LastPageNo($page = false)   X-Ref
No description

AtLastPage($status=false)   X-Ref
set/returns the status of the atLastPage flag when paginating


Class: ADORecordSet_array  - X-Ref

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
ADORecordSet_array($fakeid=1)   X-Ref
Constructor


InitArray($array,$typearr,$colnames=false)   X-Ref
Setup the array.

param: array        is a 2-dimensional array holding the data.
param: typearr    holds an array of types. These are the same types
param: [colnames]    array of column names. If set, then the first row of

InitArrayFields(&$array,&$fieldarr)   X-Ref
Setup the Array and datatype file objects

param: array        is a 2-dimensional array holding the data.
param: fieldarr    holds an array of ADOFieldObject's.

GetArray($nRows=-1)   X-Ref
No description

_initrs()   X-Ref
No description

Fields($colname)   X-Ref
No description

FetchField($fieldOffset = -1)   X-Ref
No description

_seek($row)   X-Ref
No description

MoveNext()   X-Ref
No description

_fetch()   X-Ref
No description

_close()   X-Ref
No description

ADOLoadDB($dbType)   X-Ref
Synonym for ADOLoadCode. Private function. Do not use.


ADOLoadCode($dbType)   X-Ref
Load the code for a specific database driver. Private function. Do not use.


NewADOConnection($db='')   X-Ref
synonym for ADONewConnection for people like me who cannot remember the correct name


ADONewConnection($db='')   X-Ref
Instantiate a new Connection class for a specific database driver.

param: [db]  is the database Connection object to create. If undefined,
return: the freshly created instance of the Connection class.

_adodb_getdriver($provider,$drivername,$perf=false)   X-Ref
No description

NewPerfMonitor(&$conn)   X-Ref
No description

NewDataDictionary(&$conn,$drivername=false)   X-Ref
No description

adodb_pr($var,$as_string=false)   X-Ref
No description

adodb_backtrace($printOrArr=true,$levels=9999)   X-Ref
No description

Functions
Functions that are not part of a class:

ADODB_str_replace($src, $dest, $data)   X-Ref
No description

ADODB_Setup()   X-Ref
No description



[ Powered by PHPXref - Served by Debian GNU/Linux ]