Documentation TYPO3 par Ameos

ADODB_mysql Class Reference

Inheritance diagram for ADODB_mysql:
[legend]
Collaboration diagram for ADODB_mysql:
[legend]
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()'
 Use 'true' to store the item compressed (uses zlib).
 $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.


Member Function Documentation

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.

References ADOConnection::_findvers(), and ADOConnection::GetOne().

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

References ADOConnection::MetaTables(), and qstr().

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

References ADOConnection::$false, ADOConnection::Execute(), and ADOConnection::SetFetchMode().

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.

Referenced by MetaTables().

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.

References ADOConnection::GetOne(), and SelectLimit().

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.

References ADOConnection::outp().

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.

References ADOConnection::Execute().

& 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::SQLDate ( fmt,
col = false 
)

Reimplemented from ADOConnection.

Definition at line 242 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::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 470 of file adodb-mysql.inc.php.

Referenced by _connect(), _pconnect(), and MetaColumns().

& 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 481 of file adodb-mysql.inc.php.

References ADOConnection::CacheExecute(), and ADOConnection::Execute().

Referenced by GetOne().

ADODB_mysql::ErrorMsg (  ) 

Returns:
the last error message

Reimplemented from ADOConnection.

Definition at line 504 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 514 of file adodb-mysql.inc.php.


The documentation for this class was generated from the following file:


Généré par L'expert TYPO3 avec  doxygen 1.4.6