MediaWiki
master
|
Public Member Functions | |
affectedRows () | |
Get the number of rows affected by the last write query. | |
dataSeek ($res, $row) | |
Change the position of the cursor in a result object. | |
fetchObject ($res) | |
Fetch the next row from the given result object, in object form. | |
fetchRow ($res) | |
Fetch the next row from the given result object, in associative array form. | |
fieldInfo ($table, $field) | |
mysql_fetch_field() wrapper Returns false if the field doesn't exist | |
fieldName ($res, $n) | |
Get a field name in a result object. | |
getServerInfo () | |
A string describing the current software version, and possibly other details in a user-friendly way. | |
getServerVersion () | |
A string describing the current software version, like from mysql_get_server_info(). | |
getType () | |
Get the type of the DBMS, as it appears in $wgDBtype. | |
indexInfo ($table, $index, $fname= 'Database::indexInfo') | |
Get information about an index into an object. | |
insertId () | |
Get the inserted value of an auto-increment row. | |
lastErrno () | |
Get the last error number. | |
lastError () | |
Get a description of the last error. | |
numFields ($res) | |
Get the number of fields in a result object. | |
numRows ($res) | |
Get the number of rows in a result object. | |
open ($server, $user, $password, $dbName) | |
Open a connection to the database. | |
strencode ($s) | |
Wrapper for addslashes() | |
Static Public Member Functions | |
static | getSoftwareLink () |
Returns a wikitext link to the DB's website, e.g., return "[http://www.mysql.com/ MySQL]"; Should at least contain plain text, if for some reason your database has no website. |
Definition at line 41 of file Database.php.
Get the number of rows affected by the last write query.
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
DatabaseType::dataSeek | ( | $ | res, |
$ | row | ||
) |
Change the position of the cursor in a result object.
$res | Mixed: A SQL result |
$row | Mixed: Either MySQL row or ResultWrapper |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
DatabaseType::fetchObject | ( | $ | res | ) |
Fetch the next row from the given result object, in object form.
Fields can be retrieved with $row->fieldname, with fields acting like member variables.
$res | ResultWrapper|object as returned from DatabaseBase::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
DatabaseType::fetchRow | ( | $ | res | ) |
Fetch the next row from the given result object, in associative array form.
Fields are retrieved with $row['fieldname'].
$res | ResultWrapper result object as returned from DatabaseBase::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
DatabaseType::fieldInfo | ( | $ | table, |
$ | field | ||
) |
mysql_fetch_field() wrapper Returns false if the field doesn't exist
$table | string: table name |
$field | string: field name |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseSqlite, and DatabaseMysql.
DatabaseType::fieldName | ( | $ | res, |
$ | n | ||
) |
Get a field name in a result object.
$res | Mixed: A SQL result |
$n | Integer |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
A string describing the current software version, and possibly other details in a user-friendly way.
Will be listed on Special:Version, etc. Use getServerVersion() to get machine-friendly information.
Implemented in DatabaseSqlite, and DatabaseBase.
A string describing the current software version, like from mysql_get_server_info().
Implemented in DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseIbm_db2, DatabaseMysql, and DatabaseSqlite.
static DatabaseType::getSoftwareLink | ( | ) | [static] |
Returns a wikitext link to the DB's website, e.g., return "[http://www.mysql.com/ MySQL]"; Should at least contain plain text, if for some reason your database has no website.
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseMysql, DatabaseMssql, and DatabaseSqlite.
Get the type of the DBMS, as it appears in $wgDBtype.
Implemented in DatabaseMssql, DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, and DatabaseMysql.
DatabaseType::indexInfo | ( | $ | table, |
$ | index, | ||
$ | fname = 'Database::indexInfo' |
||
) |
Get information about an index into an object.
$table | string: Table name |
$index | string: Index name |
$fname | string: Calling function name |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
Get the inserted value of an auto-increment row.
The value inserted should be fetched from nextSequenceValue()
Example: $id = $dbw->nextSequenceValue('page_page_id_seq'); $dbw->insert('page',array('page_id' => $id)); $id = $dbw->insertId();
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
Get the last error number.
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
Get a description of the last error.
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
DatabaseType::numFields | ( | $ | res | ) |
Get the number of fields in a result object.
$res | Mixed: A SQL result |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
DatabaseType::numRows | ( | $ | res | ) |
Get the number of rows in a result object.
$res | Mixed: A SQL result |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysql, and DatabaseMssql.
DatabaseType::open | ( | $ | server, |
$ | user, | ||
$ | password, | ||
$ | dbName | ||
) |
Open a connection to the database.
Usually aborts on failure
$server | String: database server host |
$user | String: database user name |
$password | String: database user password |
$dbName | String: database name |
DBConnectionError |
Implemented in DatabaseIbm_db2, DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMssql, and DatabaseMysql.
DatabaseType::strencode | ( | $ | s | ) |
Wrapper for addslashes()
$s | string: to be slashed. |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseIbm_db2, DatabaseSqlite, and DatabaseMysql.