ADODB_mysql Class Reference

Inheritance diagram for ADODB_mysql:

ADOConnection ADODB_mysqlt List of all members.

Public Member Functions

 ADODB_mysql ()
 ServerInfo ()
 IfNull ($field, $ifNull)
MetaTables ($ttype=false, $showSchema=false, $mask=false)
MetaIndexes ($table, $primary=FALSE, $owner=false)
 qstr ($s, $magic_quotes=false)
 _insertid ()
 GetOne ($sql, $inputarr=false)
 BeginTrans ()
 _affectedrows ()
 CreateSequence ($seqname='adodbseq', $startID=1)
 GenID ($seqname='adodbseq', $startID=1)
MetaDatabases ()
 SQLDate ($fmt, $col=false)
 Concat ()
 OffsetDate ($dayFraction, $date=false)
 _connect ($argHostname, $argUsername, $argPassword, $argDatabasename)
 _pconnect ($argHostname, $argUsername, $argPassword, $argDatabasename)
 _nconnect ($argHostname, $argUsername, $argPassword, $argDatabasename)
MetaColumns ($table)
 SelectDB ($dbName)
SelectLimit ($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs=0)
 _query ($sql, $inputarr)
 ErrorMsg ()
 ErrorNo ()
 _close ()
 CharMax ()
 TextMax ()
 MetaForeignKeys ($table, $owner=FALSE, $upper=FALSE, $associative=FALSE)

Public Attributes

 $databaseType = 'mysql'
 $dataProvider = 'mysql'
 $hasInsertID = true
 $hasAffectedRows = true
 supports autoincrement ID?
 $metaTablesSQL = "SHOW TABLES"
 $metaColumnsSQL = "SHOW COLUMNS FROM %s"
 $fmtTimeStamp = "'Y-m-d H:i:s'"
 used by DBDate() as the default date format used by the database
 $hasLimit = true
 support mssql/access SELECT TOP 10 * FROM TABLE
 $hasMoveFirst = true
 this is a readonly database - used by phpLens
 $hasGenID = true
 has ability to run MoveFirst(), scrolling backwards
 $isoDates = true
 error function to call
 $sysDate = 'CURDATE()'
 cache for 1 hour
 $sysTimeStamp = 'NOW()'
 name of function that returns the current date
 $hasTransactions = false
 can generate sequences using GenID();
 $forceNewConnect = false
 $poorAffectedRows = true
 $clientFlags = 0
 $substr = "substring"
 default concat operator -- change to || for Oracle/Interbase
 $nameQuote = '`'
 string to use to replace quotes
 $compat323 = false
 string to use to quote identifiers and names
 $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);"
 $_genSeqSQL = "create table %s (id int not null)"
 $_genSeq2SQL = "insert into %s values (%s)"
 $_dropSeqSQL = "drop table %s"

Detailed Description

Definition at line 21 of file adodb-mysql.inc.php.


Constructor & Destructor Documentation

ADODB_mysql.ADODB_mysql  ) 
 

Definition at line 43 of file adodb-mysql.inc.php.


Member Function Documentation

ADODB_mysql._affectedrows  ) 
 

Definition at line 178 of file adodb-mysql.inc.php.

ADODB_mysql._close  ) 
 

Definition at line 519 of file adodb-mysql.inc.php.

ADODB_mysql._connect argHostname,
argUsername,
argPassword,
argDatabasename
 

Definition at line 349 of file adodb-mysql.inc.php.

ADODB_mysql._insertid  ) 
 

Definition at line 152 of file adodb-mysql.inc.php.

ADODB_mysql._nconnect argHostname,
argUsername,
argPassword,
argDatabasename
 

Reimplemented from ADOConnection.

Definition at line 382 of file adodb-mysql.inc.php.

ADODB_mysql._pconnect argHostname,
argUsername,
argPassword,
argDatabasename
 

Definition at line 368 of file adodb-mysql.inc.php.

ADODB_mysql._query sql,
inputarr
 

Definition at line 492 of file adodb-mysql.inc.php.

ADODB_mysql.BeginTrans  ) 
 

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

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

Reimplemented from ADOConnection.

Reimplemented in ADODB_mysqlt.

Definition at line 173 of file adodb-mysql.inc.php.

ADODB_mysql.CharMax  ) 
 

Definition at line 529 of file adodb-mysql.inc.php.

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

Returns:
concatenated string

Reimplemented from ADOConnection.

Definition at line 330 of file adodb-mysql.inc.php.

ADODB_mysql.CreateSequence seqname = 'adodbseq',
startID = 1
 

Reimplemented from ADOConnection.

Definition at line 190 of file adodb-mysql.inc.php.

ADODB_mysql.ErrorMsg  ) 
 

Returns:
the last error message

Reimplemented from ADOConnection.

Definition at line 501 of file adodb-mysql.inc.php.

ADODB_mysql.ErrorNo  ) 
 

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

Reimplemented from ADOConnection.

Definition at line 511 of file adodb-mysql.inc.php.

ADODB_mysql.GenID seqname = 'adodbseq',
startID = 1
 

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

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

Reimplemented from ADOConnection.

Definition at line 201 of file adodb-mysql.inc.php.

ADODB_mysql.GetOne sql,
inputarr = false
 

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

Parameters:
sql SQL statement
[inputarr] input bind array

Reimplemented from ADOConnection.

Definition at line 158 of file adodb-mysql.inc.php.

ADODB_mysql.IfNull field,
ifNull
 

Reimplemented from ADOConnection.

Definition at line 55 of file adodb-mysql.inc.php.

& ADODB_mysql.MetaColumns table  ) 
 

Definition at line 388 of file adodb-mysql.inc.php.

& ADODB_mysql.MetaDatabases  ) 
 

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

Returns:
an array of database names.

Reimplemented from ADOConnection.

Definition at line 226 of file adodb-mysql.inc.php.

ADODB_mysql.MetaForeignKeys table,
owner = FALSE,
upper = FALSE,
associative = FALSE
 

Definition at line 543 of file adodb-mysql.inc.php.

& ADODB_mysql.MetaIndexes table,
primary = FALSE,
owner = false
 

List indexes on a table as an array.

Parameters:
table table name to query
primary true 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 ) )

Reimplemented from ADOConnection.

Definition at line 79 of file adodb-mysql.inc.php.

& ADODB_mysql.MetaTables ttype = false,
showSchema = false,
mask = false
 

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

Reimplemented from ADOConnection.

Definition at line 61 of file adodb-mysql.inc.php.

ADODB_mysql.OffsetDate dayFraction,
date = false
 

Reimplemented from ADOConnection.

Definition at line 341 of file adodb-mysql.inc.php.

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

Parameters:
s the 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

Reimplemented from ADOConnection.

Definition at line 133 of file adodb-mysql.inc.php.

ADODB_mysql.SelectDB dbName  ) 
 

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

Parameters:
dbName is the name of the database to select
Returns:
true or false

Reimplemented from ADOConnection.

Definition at line 467 of file adodb-mysql.inc.php.

& ADODB_mysql.SelectLimit sql,
nrows = -1,
offset = -1,
inputarr = false,
secs = 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

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

Reimplemented from ADOConnection.

Definition at line 478 of file adodb-mysql.inc.php.

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

Reimplemented from ADOConnection.

Definition at line 48 of file adodb-mysql.inc.php.

ADODB_mysql.SQLDate fmt,
col = false
 

FALL THROUGH

Reimplemented from ADOConnection.

Definition at line 242 of file adodb-mysql.inc.php.

ADODB_mysql.TextMax  ) 
 

Definition at line 537 of file adodb-mysql.inc.php.


Member Data Documentation

ADODB_mysql.$_dropSeqSQL = "drop table %s"
 

Definition at line 188 of file adodb-mysql.inc.php.

ADODB_mysql.$_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);"
 

Definition at line 185 of file adodb-mysql.inc.php.

ADODB_mysql.$_genSeq2SQL = "insert into %s values (%s)"
 

Definition at line 187 of file adodb-mysql.inc.php.

ADODB_mysql.$_genSeqSQL = "create table %s (id int not null)"
 

Definition at line 186 of file adodb-mysql.inc.php.

ADODB_mysql.$clientFlags = 0
 

Definition at line 38 of file adodb-mysql.inc.php.

ADODB_mysql.$compat323 = false
 

string to use to quote identifiers and names

Definition at line 41 of file adodb-mysql.inc.php.

ADODB_mysql.$databaseType = 'mysql'
 

Reimplemented from ADOConnection.

Reimplemented in ADODB_mysqlt.

Definition at line 22 of file adodb-mysql.inc.php.

ADODB_mysql.$dataProvider = 'mysql'
 

Reimplemented from ADOConnection.

Definition at line 23 of file adodb-mysql.inc.php.

ADODB_mysql.$fmtTimeStamp = "'Y-m-d H:i:s'"
 

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

Reimplemented from ADOConnection.

Definition at line 28 of file adodb-mysql.inc.php.

ADODB_mysql.$forceNewConnect = false
 

Definition at line 36 of file adodb-mysql.inc.php.

ADODB_mysql.$hasAffectedRows = true
 

supports autoincrement ID?

Reimplemented from ADOConnection.

Definition at line 25 of file adodb-mysql.inc.php.

ADODB_mysql.$hasGenID = true
 

has ability to run MoveFirst(), scrolling backwards

Reimplemented from ADOConnection.

Definition at line 31 of file adodb-mysql.inc.php.

ADODB_mysql.$hasInsertID = true
 

Reimplemented from ADOConnection.

Definition at line 24 of file adodb-mysql.inc.php.

ADODB_mysql.$hasLimit = true
 

support mssql/access SELECT TOP 10 * FROM TABLE

Reimplemented from ADOConnection.

Definition at line 29 of file adodb-mysql.inc.php.

ADODB_mysql.$hasMoveFirst = true
 

this is a readonly database - used by phpLens

Reimplemented from ADOConnection.

Definition at line 30 of file adodb-mysql.inc.php.

ADODB_mysql.$hasTransactions = false
 

can generate sequences using GenID();

Reimplemented from ADOConnection.

Reimplemented in ADODB_mysqlt.

Definition at line 35 of file adodb-mysql.inc.php.

ADODB_mysql.$isoDates = true
 

error function to call

Reimplemented from ADOConnection.

Definition at line 32 of file adodb-mysql.inc.php.

ADODB_mysql.$metaColumnsSQL = "SHOW COLUMNS FROM %s"
 

Definition at line 27 of file adodb-mysql.inc.php.

ADODB_mysql.$metaTablesSQL = "SHOW TABLES"
 

Reimplemented from ADOConnection.

Definition at line 26 of file adodb-mysql.inc.php.

ADODB_mysql.$nameQuote = '`'
 

string to use to replace quotes

Reimplemented from ADOConnection.

Definition at line 40 of file adodb-mysql.inc.php.

ADODB_mysql.$poorAffectedRows = true
 

Reimplemented from ADOConnection.

Definition at line 37 of file adodb-mysql.inc.php.

ADODB_mysql.$substr = "substring"
 

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

Reimplemented from ADOConnection.

Definition at line 39 of file adodb-mysql.inc.php.

ADODB_mysql.$sysDate = 'CURDATE()'
 

cache for 1 hour

Reimplemented from ADOConnection.

Definition at line 33 of file adodb-mysql.inc.php.

ADODB_mysql.$sysTimeStamp = 'NOW()'
 

name of function that returns the current date

Reimplemented from ADOConnection.

Definition at line 34 of file adodb-mysql.inc.php.


The documentation for this class was generated from the following file:
Generated on Fri Apr 7 10:48:44 2006 for TYPO3 by  doxygen 1.4.6