phpDocumentor epesi-base
database
[ class tree: epesi-base ] [ index: epesi-base ] [ all elements ]

Class: DB

Source Location: /include/database.php

Class DB

Property Summary
static mixed   $ado  

[ Top ]
Method Summary
static void   &addq()   * Quotes a string, without prefixing nor appending quotes.
static void   &Affected_Rows()   * @return # rows affected by UPDATE/DELETE
static void   &AutoExecute()  
static void   &BeginTrans()   * Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans(). * * @return true if succeeded or false if database does not support transactions
static void   &BindDate()  
static void   &BindTimeStamp()  
static void   &BlobDecode()  
static void   &BlobEncode()  
static void   &CacheExecute()   * Execute SQL, caching recordsets. * * @param [secs2cache] seconds to cache data, set to 0 to force query. * This is an optional parameter. * @param sql SQL statement to execute * @param [inputarr] holds the input data to bind to * @return RecordSet or false
static void   &CacheFlush()   * Flush cached recordsets that match a particular $sql statement. * If $sql == false, then we purge all files in the cache.
static void   &CacheGetAll()  
static void   &CacheGetArray()  
static void   &CacheGetAssoc()  
static void   &CacheGetCol()  
static void   &CacheGetOne()  
static void   &CacheGetRow()  
static void   &CachePageExecute()   * 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')
static void   &CacheSelectLimit()   * 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')
static void   &Close()   * Close Connection
static void   CommitLock()  
static void   &CommitTrans()   * 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.
static void   CompleteTrans()   Used together with StartTrans() to end a transaction. Monitors connection for sql errors, and will commit or rollback as appropriate. @autoComplete 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.
static void   &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); * * @return concatenated string
static void   Connect()   Connect to database.
static void   CreateIndex()  
static void   &CreateSequence()  
static void   CreateTable()  
static void   &DBDate()   * 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
static void   &DBTimeStamp()   * 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
static void   &dict()  
static void   Disconnect()   Destroy database connection.
static void   DropIndex()  
static void   &DropSequence()  
static void   DropTable()  
static void   &ErrorMsg()   * @return the last error message
static void   &ErrorNo()   * @return the last error number. Normally 0 means no error.
static void   &escape()  
static void   &Execute()   * 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
static void   FailTrans()  
static void   &GenID()   * 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
static void   &GetActiveRecords()  
static void   &GetActiveRecordsClass()  
static void   &GetAll()  
static void   &GetArray()   * * @param sql SQL statement * @param [inputarr] input bind array
static void   &GetAssoc()  
static void   &GetCharSet()  
static void   &GetCol()  
static void   &GetInsertSQL()   * 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.
static void   &GetOne()   * Return first element of first row of sql statement. Recordset is disposed * for you. * * @param sql SQL statement * @param [inputarr] input bind array
static integer   GetQueries()   Statistics only. Get number of queries till now.
static void   &GetRow()   * Return one row of sql statement. Recordset is disposed for you. * * @param sql SQL statement * @param [inputarr] input bind array
static void   &GetUpdateSQL()   * 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"
static void   HasFailedTrans()   Check if transaction has failed, only for Smart Transactions.
static void   &IfNull()  
static void   IgnoreErrors()  
static void   InParameter()  
static void   &Insert_ID()   * @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.
static void   &LogSQL()  
static void   &MetaColumnNames()   * List columns names in a table as an array. * @param table table name to query * * @return array of column names for current table.
static void   &MetaColumns()   * 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 $normalize makes table name case-insensitive (required by some databases) * @schema is optional database schema to use - not supported by all databases. * * @return array of ADOFieldObjects for current table.
static void   &MetaDatabases()   * return the databases that the driver can connect to. * Some databases will return an empty array. * * @return an array of database names.
static void   &MetaError()  
static void   &MetaErrorMsg()  
static void   &MetaForeignKeys()   * @returns assoc array where keys are tables, and values are foreign keys
static void   &MetaIndexes()   * 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. Array ( [name_of_index] => Array ( [unique] => true or false [columns] => Array ( [0] => firstname [1] => lastname ) )
static void   &MetaPrimaryKeys()   * @returns an array with the primary key columns in it.
static void   &MetaTables()   * @param 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 * @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.
static void   &MetaTransaction()  
static void   &MetaType()  
static void   &OffsetDate()  
static void   OutParameter()  
static void   &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. * * 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') * * NOTE: phpLens uses a different algorithm and does not use PageExecute(). *
static void   Param()  
static void   Parameter()  
static void   &PO_Insert_ID()   * Portable Insert ID. Pablo Roca * * @return the last inserted ID. All databases support this. But aware possible * problems in multiuser environments. Heavy test this before deploying.
static void   Prepare()   * 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 * if the database does not support prepare. *
static void   PrepareSP()   * 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 * if the database does not support prepare. *
static void   q()  
static void   QMagic()   Requested by "Karsten Dambekalns"
static void   &qstr()   * 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(). * This undoes the stupidity of magic quotes for GPC. * * @return quoted string to be sent back to database
static void   Quote()   * PEAR DB Compat
static void   RenameColumn()  
static void   &Replace()   * 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
static void   RollbackLock()  
static void   &RollbackTrans()   * If database does not support transactions, rollbacks always fail, so return false * * @return true/false.
static void   RowLock()   * 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
static void   &SelectLimit()   * 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')
static void   &SerializableRS()   * Create serializable recordset. Breaks rs link to connection. * * @param rs the recordset to serialize
static void   ServerInfo()   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).
static void   &SetCharSet()  
static void   &SetDateLocale()   * Change the SQL connection locale to a specified locale. * This is used to get the date formats written depending on the client locale.
static void   &SetTransactionMode()  
static void   SQLDate()  
static void   StartTrans()   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.
static void   Time()  
static void   &Transpose()  
static void   TypeControl()  
static void   &UnixDate()   * 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
static void   &UnixTimeStamp()   * 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
static void   &UpdateBlob()   * 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');
static void   &UpdateBlobFile()   * 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');
static void   &UpdateClob()   * 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');
static void   &UserDate()   * 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
static void   &UserTimeStamp()   * * @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
static void   Version()  
static void   &xCacheFlush()  

[ Top ]
Properties
static mixed   $ado [line 26]
API Tags:
Access:  public


[ Top ]
Methods
static method addq  [line 864]

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

* Quotes a string, without prefixing nor appending quotes.

Parameters:
   $s: 
   $magic_quotes: 

API Tags:
Access:  public


[ Top ]
static method Affected_Rows  [line 351]

  static void &Affected_Rows( )

* @return # rows affected by UPDATE/DELETE


API Tags:
Access:  public


[ Top ]
static method AutoExecute  [line 598]

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

Parameters:
   $table: 
   $fields_values: 
   $mode: 
   $where: 
   $forceUpdate: 
   $magicq: 

API Tags:
Access:  public


[ Top ]
static method BeginTrans  [line 724]

  static void &BeginTrans( )

* Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans(). * * @return true if succeeded or false if database does not support transactions


API Tags:
Access:  public


[ Top ]
static method BindDate  [line 808]

  static void &BindDate( $d  )

Parameters:
   $d: 

API Tags:
Access:  public


[ Top ]
static method BindTimeStamp  [line 815]

  static void &BindTimeStamp( $d  )

Parameters:
   $d: 

API Tags:
Access:  public


[ Top ]
static method BlobDecode  [line 633]

  static void &BlobDecode( $blob  )

Parameters:
   $blob: 

API Tags:
Access:  public


[ Top ]
static method BlobEncode  [line 640]

  static void &BlobEncode( $blob  )

Parameters:
   $blob: 

API Tags:
Access:  public


[ Top ]
static method CacheExecute  [line 588]

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

* Execute SQL, caching recordsets. * * @param [secs2cache] seconds to cache data, set to 0 to force query. * This is an optional parameter. * @param sql SQL statement to execute * @param [inputarr] holds the input data to bind to * @return RecordSet or false

Parameters:
   $secs2cache: 
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method CacheFlush  [line 568]

  static 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: 

API Tags:
Access:  public


[ Top ]
static method CacheGetAll  [line 511]

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

Parameters:
   $secs2cache: 
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method CacheGetArray  [line 521]

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

Parameters:
   $secs2cache: 
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method CacheGetAssoc  [line 437]

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

Parameters:
   $secs2cache: 
   $sql: 
   $inputarr: 
   $force_array: 
   $first2cols: 

API Tags:
Access:  public


[ Top ]
static method CacheGetCol  [line 477]

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

Parameters:
   $secs: 
   $sql: 
   $inputarr: 
   $trim: 

API Tags:
Access:  public


[ Top ]
static method CacheGetOne  [line 457]

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

Parameters:
   $secs2cache: 
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method CacheGetRow  [line 541]

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

Parameters:
   $secs2cache: 
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method CachePageExecute  [line 888]

  static void &CachePageExecute( $secs2cache, $sql, $nrows, $page, [ $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. * * @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')

Parameters:
   $secs2cache: 
   $sql: 
   $nrows: 
   $page: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method CacheSelectLimit  [line 558]

  static void &CacheSelectLimit( $secs2cache, $sql, [ $nrows = -1], [ $offset = -1], [ $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 * * @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')

Parameters:
   $secs2cache: 
   $sql: 
   $nrows: 
   $offset: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method Close  [line 717]

  static void &Close( )

* Close Connection


API Tags:
Access:  public


[ Top ]
static method CommitLock  [line 227]

  static void CommitLock( $table  )

Parameters:
   $table: 

API Tags:
Access:  public


[ Top ]
static method CommitTrans  [line 745]

  static void &CommitTrans( [ $ok = true]  )

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

Parameters:
   $ok: 

API Tags:
Access:  public


[ Top ]
static method CompleteTrans  [line 285]

  static void CompleteTrans( [ $autoComplete = true]  )

Used together with StartTrans() to end a transaction. Monitors connection for sql errors, and will commit or rollback as appropriate. @autoComplete 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.

Parameters:
   $autoComplete: 

API Tags:
Access:  public


[ Top ]
static method Concat  [line 794]

  static void &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); * * @return concatenated string


API Tags:
Access:  public


[ Top ]
static method Connect  [line 32]

  static void Connect( )

Connect to database.


API Tags:
Access:  public


[ Top ]
static method CreateIndex  [line 89]

  static void CreateIndex( $name, $tab, $cols, [ $opts = null]  )

Parameters:
   $name: 
   $tab: 
   $cols: 
   $opts: 

API Tags:
Access:  public


[ Top ]
static method CreateSequence  [line 316]

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

Parameters:
   $seqname: 
   $startID: 

API Tags:
Access:  public


[ Top ]
static method CreateTable  [line 73]

  static void CreateTable( $name, $cols, [ $opts = null]  )

Parameters:
   $name: 
   $cols: 
   $opts: 

API Tags:
Access:  public


[ Top ]
static method DBDate  [line 801]

  static void &DBDate( $d  )

* 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

Parameters:
   $d: 

API Tags:
Access:  public


[ Top ]
static method DBTimeStamp  [line 822]

  static void &DBTimeStamp( $ts  )

* 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

Parameters:
   $ts: 

API Tags:
Access:  public


[ Top ]
static method dict  [line 60]

  static void &dict( )


API Tags:
Access:  public


[ Top ]
static method Disconnect  [line 46]

  static void Disconnect( )

Destroy database connection.


API Tags:
Access:  public


[ Top ]
static method DropIndex  [line 82]

  static void DropIndex( $name, [ $tab = null]  )

Parameters:
   $name: 
   $tab: 

API Tags:
Access:  public


[ Top ]
static method DropSequence  [line 323]

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

Parameters:
   $seqname: 

API Tags:
Access:  public


[ Top ]
static method DropTable  [line 66]

  static void DropTable( $name  )

Parameters:
   $name: 

API Tags:
Access:  public


[ Top ]
static method ErrorMsg  [line 358]

  static void &ErrorMsg( )

* @return the last error message


API Tags:
Access:  public


[ Top ]
static method ErrorNo  [line 365]

  static void &ErrorNo( )

* @return the last error number. Normally 0 means no error.


API Tags:
Access:  public


[ Top ]
static method escape  [line 857]

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

Parameters:
   $s: 
   $magic_quotes: 

API Tags:
Access:  public


[ Top ]
static method Execute  [line 306]

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

* 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

Parameters:
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method FailTrans  [line 292]

  static void FailTrans( )


API Tags:
Access:  public


[ Top ]
static method GenID  [line 330]

  static void &GenID( [ $seqname = 'adodbseq'], [ $startID = 1]  )

* 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

Parameters:
   $seqname: 
   $startID: 

API Tags:
Access:  public


[ Top ]
static method GetActiveRecords  [line 710]

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

Parameters:
   $table: 
   $where: 
   $bindarr: 
   $primkeyArr: 

API Tags:
Access:  public


[ Top ]
static method GetActiveRecordsClass  [line 703]

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

Parameters:
   $class: 
   $table: 
   $whereOrderBy: 
   $bindarr: 
   $primkeyArr: 

API Tags:
Access:  public


[ Top ]
static method GetAll  [line 417]

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

Parameters:
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method GetArray  [line 501]

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

* * @param sql SQL statement * @param [inputarr] input bind array

Parameters:
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method GetAssoc  [line 427]

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

Parameters:
   $sql: 
   $inputarr: 
   $force_array: 
   $first2cols: 

API Tags:
Access:  public


[ Top ]
static method GetCharSet  [line 668]

  static void &GetCharSet( )


API Tags:
Access:  public


[ Top ]
static method GetCol  [line 467]

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

Parameters:
   $sql: 
   $inputarr: 
   $trim: 

API Tags:
Access:  public


[ Top ]
static method GetInsertSQL  [line 612]

  static 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: 

API Tags:
Access:  public


[ Top ]
static method GetOne  [line 447]

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

* Return first element of first row of sql statement. Recordset is disposed * for you. * * @param sql SQL statement * @param [inputarr] input bind array

Parameters:
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method GetQueries  [line 56]

  static integer GetQueries( )

Statistics only. Get number of queries till now.


API Tags:
Access:  public


[ Top ]
static method GetRow  [line 531]

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

* Return one row of sql statement. Recordset is disposed for you. * * @param sql SQL statement * @param [inputarr] input bind array

Parameters:
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]
static method GetUpdateSQL  [line 605]

  static 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"

Parameters:
   &$rs: 
   $arrFields: 
   $forceUpdate: 
   $magicq: 
   $force: 

API Tags:
Access:  public


[ Top ]
static method HasFailedTrans  [line 299]

  static void HasFailedTrans( )

Check if transaction has failed, only for Smart Transactions.


API Tags:
Access:  public


[ Top ]
static method IfNull  [line 654]

  static void &IfNull( $field, $ifNull  )

Parameters:
   $field: 
   $ifNull: 

API Tags:
Access:  public


[ Top ]
static method IgnoreErrors  [line 269]

  static void IgnoreErrors( [ $saveErrs = false]  )

Parameters:
   $saveErrs: 

API Tags:
Access:  public


[ Top ]
static method InParameter  [line 248]

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

Parameters:
   &$stmt: 
   &$var: 
   $name: 
   $maxLen: 
   $type: 

API Tags:
Access:  public


[ Top ]
static method Insert_ID  [line 337]

  static void &Insert_ID( [ $table = ''], [ $column = '']  )

* @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.

Parameters:
   $table: 
   $column: 

API Tags:
Access:  public


[ Top ]
static method LogSQL  [line 661]

  static void &LogSQL( [ $enable = true]  )

Parameters:
   $enable: 

API Tags:
Access:  public


[ Top ]
static method MetaColumnNames  [line 787]

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

* List columns names in a table as an array. * @param table table name to query * * @return array of column names for current table.

Parameters:
   $table: 
   $numIndexes: 
   $useattnum: 

API Tags:
Access:  public


[ Top ]
static method MetaColumns  [line 773]

  static void &MetaColumns( $table, [ $normalize = true]  )

* 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 $normalize makes table name case-insensitive (required by some databases) * @schema is optional database schema to use - not supported by all databases. * * @return array of ADOFieldObjects for current table.

Parameters:
   $table: 
   $normalize: 

API Tags:
Access:  public


[ Top ]
static method MetaDatabases  [line 759]

  static void &MetaDatabases( )

* return the databases that the driver can connect to. * Some databases will return an empty array. * * @return an array of database names.


API Tags:
Access:  public


[ Top ]
static method MetaError  [line 372]

  static void &MetaError( [ $err = false]  )

Parameters:
   $err: 

API Tags:
Access:  public


[ Top ]
static method MetaErrorMsg  [line 379]

  static void &MetaErrorMsg( $errno  )

Parameters:
   $errno: 

API Tags:
Access:  public


[ Top ]
static method MetaForeignKeys  [line 393]

  static void &MetaForeignKeys( $table, [ $owner = false], [ $upper = false]  )

* @returns assoc array where keys are tables, and values are foreign keys

Parameters:
   $table: 
   $owner: 
   $upper: 

API Tags:
Access:  public


[ Top ]
static method MetaIndexes  [line 780]

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

* 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. Array ( [name_of_index] => Array ( [unique] => true or false [columns] => Array ( [0] => firstname [1] => lastname ) )

Parameters:
   $table: 
   $primary: 
   $owner: 

API Tags:
Access:  public


[ Top ]
static method MetaPrimaryKeys  [line 386]

  static void &MetaPrimaryKeys( $table, [ $owner = false]  )

* @returns an array with the primary key columns in it.

Parameters:
   $table: 
   $owner: 

API Tags:
Access:  public


[ Top ]
static method MetaTables  [line 766]

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

* @param 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 * @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.

Parameters:
   $ttype: 
   $showSchema: 
   $mask: 

API Tags:
Access:  public


[ Top ]
static method MetaTransaction  [line 738]

  static void &MetaTransaction( $mode, $db  )

Parameters:
   $mode: 
   $db: 

API Tags:
Access:  public


[ Top ]
static method MetaType  [line 682]

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

Parameters:
   $t: 
   $len: 
   $fieldobj: 

API Tags:
Access:  public


[ Top ]
static method OffsetDate  [line 494]

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

Parameters:
   $dayFraction: 
   $date: 

API Tags:
Access:  public


[ Top ]
static method OutParameter  [line 255]

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

Parameters:
   &$stmt: 
   &$var: 
   $name: 
   $maxLen: 
   $type: 

API Tags:
Access:  public


[ Top ]
static method PageExecute  [line 878]

  static void &PageExecute( $sql, $nrows, $page, [ $inputarr = false], [ $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. * * @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') * * NOTE: phpLens uses a different algorithm and does not use PageExecute(). *

Parameters:
   $sql: 
   $nrows: 
   $page: 
   $inputarr: 
   $secs2cache: 

API Tags:
Access:  public


[ Top ]
static method Param  [line 241]

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

Parameters:
   $name: 
   $type: 

API Tags:
Access:  public


[ Top ]
static method Parameter  [line 262]

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

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

API Tags:
Access:  public


[ Top ]
static method PO_Insert_ID  [line 344]

  static void &PO_Insert_ID( [ $table = ''], [ $id = '']  )

* Portable Insert ID. Pablo Roca * * @return the last inserted ID. All databases support this. But aware possible * problems in multiuser environments. Heavy test this before deploying.

Parameters:
   $table: 
   $id: 

API Tags:
Access:  public


[ Top ]
static method Prepare  [line 185]

  static void Prepare( $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'); * * @param sql SQL to send to database * * @return return FALSE, or the prepared statement, or the original sql if * if the database does not support prepare. *

Parameters:
   $sql: 

API Tags:
Access:  public


[ Top ]
static method PrepareSP  [line 192]

  static void PrepareSP( $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: * * @param sql SQL to send to database * * @return return FALSE, or the prepared statement, or the original sql if * if the database does not support prepare. *

Parameters:
   $sql: 
   $param: 

API Tags:
Access:  public


[ Top ]
static method q  [line 213]

  static void q( &$s  )

Parameters:
   &$s: 

API Tags:
Access:  public


[ Top ]
static method QMagic  [line 206]

  static void QMagic( $s  )

Requested by "Karsten Dambekalns"

Parameters:
   $s: 

API Tags:
Access:  public


[ Top ]
static method qstr  [line 871]

  static void &qstr( $s, [ $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()); * * @param s the string to quote * @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc(). * This undoes the stupidity of magic quotes for GPC. * * @return quoted string to be sent back to database

Parameters:
   $s: 
   $magic_quotes: 

API Tags:
Access:  public


[ Top ]
static method Quote  [line 199]

  static void Quote( $s  )

* PEAR DB Compat

Parameters:
   $s: 

API Tags:
Access:  public


[ Top ]
static method RenameColumn  [line 688]

  static void RenameColumn( $tabname, $oldcolumn, $newcolumn, $flds  )

Parameters:
   $tabname: 
   $oldcolumn: 
   $newcolumn: 
   $flds: 

API Tags:
Access:  public


[ Top ]
static method Replace  [line 551]

  static 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: 

API Tags:
Access:  public


[ Top ]
static method RollbackLock  [line 234]

  static void RollbackLock( $table  )

Parameters:
   $table: 

API Tags:
Access:  public


[ Top ]
static method RollbackTrans  [line 752]

  static void &RollbackTrans( )

* If database does not support transactions, rollbacks always fail, so return false * * @return true/false.


API Tags:
Access:  public


[ Top ]
static method RowLock  [line 220]

  static void RowLock( $table, $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 * * @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

Parameters:
   $table: 
   $where: 

API Tags:
Access:  public


[ Top ]
static method SelectLimit  [line 400]

  static void &SelectLimit( $sql, [ $nrows = -1], [ $offset = -1], [ $inputarr = false], [ $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 * * @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')

Parameters:
   $sql: 
   $nrows: 
   $offset: 
   $inputarr: 
   $secs2cache: 

API Tags:
Access:  public


[ Top ]
static method SerializableRS  [line 410]

  static void &SerializableRS( &$rs  )

* Create serializable recordset. Breaks rs link to connection. * * @param rs the recordset to serialize

Parameters:
   &$rs: 

API Tags:
Access:  public


[ Top ]
static method ServerInfo  [line 164]

  static void ServerInfo( )

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


API Tags:
Access:  public


[ Top ]
static method SetCharSet  [line 647]

  static void &SetCharSet( $charset  )

Parameters:
   $charset: 

API Tags:
Access:  public


[ Top ]
static method SetDateLocale  [line 696]

  static 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: 

API Tags:
Access:  public


[ Top ]
static method SetTransactionMode  [line 731]

  static void &SetTransactionMode( $transaction_mode  )

Parameters:
   $transaction_mode: 

API Tags:
Access:  public


[ Top ]
static method SQLDate  [line 178]

  static void SQLDate( $fmt, [ $col = false]  )

Parameters:
   $fmt: 
   $col: 

API Tags:
Access:  public


[ Top ]
static method StartTrans  [line 278]

  static void StartTrans( [ $errfn = 'ADODB_TransMoni...']  )

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.

Parameters:
   $errfn: 

API Tags:
Access:  public


[ Top ]
static method Time  [line 171]

  static void Time( )


API Tags:
Access:  public


[ Top ]
static method Transpose  [line 487]

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

Parameters:
   &$rs: 
   $addfieldnames: 

API Tags:
Access:  public


[ Top ]
static method TypeControl  [line 100]

  static void TypeControl( $sql, &$arr  )

Parameters:
   $sql: 
   &$arr: 

API Tags:
Access:  public


[ Top ]
static method UnixDate  [line 829]

  static void &UnixDate( $v  )

* 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

Parameters:
   $v: 

API Tags:
Access:  public


[ Top ]
static method UnixTimeStamp  [line 836]

  static void &UnixTimeStamp( $v  )

* 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

Parameters:
   $v: 

API Tags:
Access:  public


[ Top ]
static method UpdateBlob  [line 619]

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

Parameters:
   $table: 
   $column: 
   $val: 
   $where: 
   $blobtype: 

API Tags:
Access:  public


[ Top ]
static method UpdateBlobFile  [line 626]

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

Parameters:
   $table: 
   $column: 
   $path: 
   $where: 
   $blobtype: 

API Tags:
Access:  public


[ Top ]
static method UpdateClob  [line 675]

  static 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: 

API Tags:
Access:  public


[ Top ]
static method UserDate  [line 843]

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

* 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

Parameters:
   $v: 
   $fmt: 
   $gmt: 

API Tags:
Access:  public


[ Top ]
static method UserTimeStamp  [line 850]

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

* * @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

Parameters:
   $v: 
   $fmt: 
   $gmt: 

API Tags:
Access:  public


[ Top ]
static method Version  [line 157]

  static void Version( )


API Tags:
Access:  public


[ Top ]
static method xCacheFlush  [line 578]

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

Parameters:
   $sql: 
   $inputarr: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Fri, 26 Dec 2008 21:40:42 -0500 by phpDocumentor 1.4.2