

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.ADODB_mysql | ( | ) |
Definition at line 43 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 $arr, ADOConnection._findvers(), and ADOConnection.GetOne().

| ADODB_mysql.IfNull | ( | $ | field, | |
| $ | ifNull | |||
| ) |
| 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 $ADODB_FETCH_MODE, ADOConnection.$false, $row, $rs, 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.
References $s.
Referenced by MetaTables().
| ADODB_mysql._insertid | ( | ) |
Definition at line 152 of file adodb-mysql.inc.php.
References ADOConnection.GetOne().

| 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 $rs, $sql, 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 debug, and ADOConnection.outp().

| ADODB_mysql._affectedrows | ( | ) |
Definition at line 178 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.
References $ok, and ADOConnection.Execute().

| 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 $rs, and 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 | |||
| ) |
FALL THROUGH
Reimplemented from ADOConnection.
Definition at line 242 of file adodb-mysql.inc.php.
References $s.
| 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.OffsetDate | ( | $ | dayFraction, | |
| $ | date = false | |||
| ) |
Reimplemented from ADOConnection.
Definition at line 341 of file adodb-mysql.inc.php.
References $date.
| ADODB_mysql._connect | ( | $ | argHostname, | |
| $ | argUsername, | |||
| $ | argPassword, | |||
| $ | argDatabasename | |||
| ) |
Definition at line 352 of file adodb-mysql.inc.php.
References SelectDB().
Referenced by _nconnect().

| ADODB_mysql._pconnect | ( | $ | argHostname, | |
| $ | argUsername, | |||
| $ | argPassword, | |||
| $ | argDatabasename | |||
| ) |
Definition at line 371 of file adodb-mysql.inc.php.
References ADOConnection.RollbackTrans(), and SelectDB().

| ADODB_mysql._nconnect | ( | $ | argHostname, | |
| $ | argUsername, | |||
| $ | argPassword, | |||
| $ | argDatabasename | |||
| ) |
Reimplemented from ADOConnection.
Definition at line 385 of file adodb-mysql.inc.php.
References _connect().

| & ADODB_mysql.MetaColumns | ( | $ | table | ) |
Definition at line 391 of file adodb-mysql.inc.php.
References $ADODB_FETCH_MODE, $arr, ADOConnection.$false, $rs, $schema, ADOConnection._findschema(), database, ADOConnection.Execute(), SelectDB(), and ADOConnection.SetFetchMode().

| 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.
References database.
Referenced by _connect(), _pconnect(), and MetaColumns().
| & ADODB_mysql.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
| 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 $rs, $sql, ADOConnection.CacheExecute(), and ADOConnection.Execute().
Referenced by GetOne().

| ADODB_mysql._query | ( | $ | sql, | |
| $ | inputarr | |||
| ) |
| 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.
| ADODB_mysql._close | ( | ) |
Definition at line 522 of file adodb-mysql.inc.php.
| ADODB_mysql.CharMax | ( | ) |
Definition at line 532 of file adodb-mysql.inc.php.
| ADODB_mysql.TextMax | ( | ) |
Definition at line 540 of file adodb-mysql.inc.php.
| ADODB_mysql.MetaForeignKeys | ( | $ | table, | |
| $ | owner = FALSE, |
|||
| $ | upper = FALSE, |
|||
| $ | associative = FALSE | |||
| ) |
| 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' |
| ADODB_mysql.$hasInsertID = true |
| ADODB_mysql.$hasAffectedRows = true |
supports autoincrement ID?
Reimplemented from ADOConnection.
Definition at line 25 of file adodb-mysql.inc.php.
| ADODB_mysql.$metaTablesSQL = "SHOW TABLES" |
| ADODB_mysql.$metaColumnsSQL = "SHOW COLUMNS FROM `%s`" |
Definition at line 27 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.$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.$hasGenID = true |
has ability to run MoveFirst(), scrolling backwards
Reimplemented from ADOConnection.
Definition at line 31 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.$sysDate = 'CURDATE()' |
Use 'true' to store the item compressed (uses zlib).
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.
| 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.$forceNewConnect = false |
Definition at line 36 of file adodb-mysql.inc.php.
| ADODB_mysql.$poorAffectedRows = true |
| ADODB_mysql.$clientFlags = 0 |
Definition at line 38 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.$nameQuote = '`' |
string to use to replace quotes
Reimplemented from ADOConnection.
Definition at line 40 of file adodb-mysql.inc.php.
| ADODB_mysql.$compat323 = false |
| ADODB_mysql.$_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);" |
Definition at line 185 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.$_genSeq2SQL = "insert into %s values (%s)" |
Definition at line 187 of file adodb-mysql.inc.php.
| ADODB_mysql.$_dropSeqSQL = "drop table %s" |
Definition at line 188 of file adodb-mysql.inc.php.