Documentation TYPO3 par Ameos |
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" | |
Definition at line 21 of file adodb-mysql.inc.php.
| ADODB_mysql::ServerInfo | ( | ) |
Get server version info...
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 | |||
| ) |
| 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 |
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.
| table | table name to query | |
| primary | true to only show primary keys. Not actually used for most databases |
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());
| 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. |
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.
| 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().
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;
| seqname | name of sequence to use | |
| startID | if sequence does not exist, start at this 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.
Reimplemented from ADOConnection.
Definition at line 226 of file adodb-mysql.inc.php.
| ADODB_mysql::SQLDate | ( | $ | fmt, | |
| $ | col = false | |||
| ) |
| 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);
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.
| dbName | is the name of the database to select |
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
| 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 |
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 | ( | ) |
Reimplemented from ADOConnection.
Definition at line 504 of file adodb-mysql.inc.php.
| ADODB_mysql::ErrorNo | ( | ) |
Reimplemented from ADOConnection.
Definition at line 514 of file adodb-mysql.inc.php.
1.4.6