includes/DatabaseFunctions.php File Reference

Legacy database functions, for compatibility with pre-1.3 code NOTE: this file is no longer loaded by default. More...

Go to the source code of this file.

Functions

 wfQuery ($sql, $db, $fname= '')
 Usually aborts on failure If errors are explicitly ignored, returns success.
 wfSingleQuery ($sql, $dbi, $fname= '')
 wfIgnoreSQLErrors ($newstate, $dbi=DB_LAST)
 Turns on (false) or off (true) the automatic generation and sending of a "we're sorry, but there has been a database error" page on database errors.
 wfFreeResult ($res, $dbi=DB_LAST)
 #@+
 wfFetchObject ($res, $dbi=DB_LAST)
 Get an object from a database result.
 wfFetchRow ($res, $dbi=DB_LAST)
 Get a row from a database result.
 wfNumRows ($res, $dbi=DB_LAST)
 Get a number of rows from a database result.
 wfNumFields ($res, $dbi=DB_LAST)
 Get the number of fields from a database result.
 wfFieldName ($res, $n, $dbi=DB_LAST)
 Return name of a field in a result.
 wfInsertId ($dbi=DB_LAST)
 #@-
 wfDataSeek ($res, $row, $dbi=DB_LAST)
 wfLastErrno ($dbi=DB_LAST)
 Get the last error number.
 wfLastError ($dbi=DB_LAST)
 Get the last error.
 wfAffectedRows ($dbi=DB_LAST)
 Get the number of affected rows.
 wfLastDBquery ($dbi=DB_LAST)
 Get the last query ran.
 wfSetSQL ($table, $var, $value, $cond, $dbi=DB_MASTER)
 wfGetSQL ($table, $var, $cond='', $dbi=DB_LAST)
 Simple select wrapper, return one field.
 wfFieldExists ($table, $field, $dbi=DB_LAST)
 Does a given field exist on the specified table?
 wfIndexExists ($table, $index, $dbi=DB_LAST)
 Does the requested index exist on the specified table?
 wfInsertArray ($table, $array, $fname= 'wfInsertArray', $dbi=DB_MASTER)
 wfGetArray ($table, $vars, $conds, $fname= 'wfGetArray', $dbi=DB_LAST)
 wfUpdateArray ($table, $values, $conds, $fname= 'wfUpdateArray', $dbi=DB_MASTER)
 wfTableName ($name, $dbi=DB_LAST)
 Get fully usable table name.
 wfStrencode ($s, $dbi=DB_LAST)
 wfNextSequenceValue ($seqName, $dbi=DB_MASTER)
 wfUseIndexClause ($index, $dbi=DB_SLAVE)


Detailed Description

Legacy database functions, for compatibility with pre-1.3 code NOTE: this file is no longer loaded by default.

Definition in file DatabaseFunctions.php.


Function Documentation

wfAffectedRows ( dbi = DB_LAST  ) 

Get the number of affected rows.

See also:
Database::affectedRows()

Definition at line 211 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfDataSeek ( res,
row,
dbi = DB_LAST 
)

Todo:
document function
See also:
Database::dataSeek()

Definition at line 172 of file DatabaseFunctions.php.

References $db, $res, $row, and wfGetDB().

wfFetchObject ( res,
dbi = DB_LAST 
)

Get an object from a database result.

Returns:
object|false object we requested

Definition at line 89 of file DatabaseFunctions.php.

References $db, $res, and wfGetDB().

Referenced by rebuildRecentChangesTable(), and rebuildRecentChangesTablePass2().

wfFetchRow ( res,
dbi = DB_LAST 
)

Get a row from a database result.

Returns:
object|false row we requested

Definition at line 102 of file DatabaseFunctions.php.

References $db, $res, and wfGetDB().

wfFieldExists ( table,
field,
dbi = DB_LAST 
)

Does a given field exist on the specified table?

See also:
Database::fieldExists()
Parameters:
$table 
$field 
$dbi Default DB_LAST
Returns:
Result of Database::fieldExists() or false.

Definition at line 279 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfFieldName ( res,
n,
dbi = DB_LAST 
)

Return name of a field in a result.

Parameters:
$res Mixed: Ressource link see Database::fieldName()
$n Integer: id of the field
$dbi Default DB_LAST
Returns:
string|false name of field

Definition at line 144 of file DatabaseFunctions.php.

References $db, $n, $res, and wfGetDB().

wfFreeResult ( res,
dbi = DB_LAST 
)

#@+

Parameters:
$res Database result handler
$dbi Free a database result
Returns:
Bool: whether result is sucessful or not.

Definition at line 74 of file DatabaseFunctions.php.

References $db, $res, and wfGetDB().

wfGetArray ( table,
vars,
conds,
fname = 'wfGetArray',
dbi = DB_LAST 
)

See also:
Database::getArray()
Todo:
document function
Parameters:
$table String
$vars 
$conds 
$fname String, default 'wfGetArray'.
$dbi Default DB_LAST
Returns:
result of Database::getArray() or false.

Definition at line 333 of file DatabaseFunctions.php.

References $conds, $db, $fname, and wfGetDB().

wfGetSQL ( table,
var,
cond = '',
dbi = DB_LAST 
)

Simple select wrapper, return one field.

See also:
Database::selectField()
Parameters:
$table 
$var 
$cond Default ''
$dbi Default DB_LAST

Definition at line 261 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfIgnoreSQLErrors ( newstate,
dbi = DB_LAST 
)

Turns on (false) or off (true) the automatic generation and sending of a "we're sorry, but there has been a database error" page on database errors.

Default is on (false). When turned off, the code should use wfLastErrno() and wfLastError() to handle the situation as appropriate.

Parameters:
$newstate 
$dbi 
Returns:
Returns the previous state.

Definition at line 56 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfIndexExists ( table,
index,
dbi = DB_LAST 
)

Does the requested index exist on the specified table?

See also:
Database::indexExists()
Parameters:
$table String
$index 
$dbi Default DB_LAST
Returns:
Result of Database::indexExists() or false.

Definition at line 296 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfInsertArray ( table,
array,
fname = 'wfInsertArray',
dbi = DB_MASTER 
)

See also:
Database::insert()
Todo:
document function
Parameters:
$table String
$array Array
$fname String, default 'wfInsertArray'.
$dbi Default DB_MASTER
Returns:
result of Database::insert() or false.

Definition at line 314 of file DatabaseFunctions.php.

References $db, $fname, and wfGetDB().

wfInsertId ( dbi = DB_LAST  ) 

#@-

Todo:
document function
See also:
Database::insertId()

Definition at line 159 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfLastDBquery ( dbi = DB_LAST  ) 

Get the last query ran.

See also:
Database::lastQuery

Definition at line 224 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfLastErrno ( dbi = DB_LAST  ) 

Get the last error number.

See also:
Database::lastErrno()

Definition at line 185 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfLastError ( dbi = DB_LAST  ) 

Get the last error.

See also:
Database::lastError()

Definition at line 198 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfNextSequenceValue ( seqName,
dbi = DB_MASTER 
)

Todo:
document function
See also:
Database::nextSequenceValue()

Definition at line 392 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfNumFields ( res,
dbi = DB_LAST 
)

Get the number of fields from a database result.

Returns:
integer|false number of fields

Definition at line 128 of file DatabaseFunctions.php.

References $db, $res, and wfGetDB().

wfNumRows ( res,
dbi = DB_LAST 
)

Get a number of rows from a database result.

Returns:
integer|false number of rows

Definition at line 115 of file DatabaseFunctions.php.

References $db, $res, and wfGetDB().

Referenced by rebuildRecentChangesTablePass2().

wfQuery ( sql,
db,
fname = '' 
)

Usually aborts on failure If errors are explicitly ignored, returns success.

Parameters:
$sql String: SQL query
$db Mixed: database handler
$fname String: name of the php function calling

Definition at line 16 of file DatabaseFunctions.php.

References $db, $fname, $sql, wfGetDB(), and wfMsgNoDB().

Referenced by rebuildRecentChangesTable(), and rebuildRecentChangesTablePass2().

wfSetSQL ( table,
var,
value,
cond,
dbi = DB_MASTER 
)

See also:
Database::Set()
Todo:
document function
Parameters:
$table 
$var 
$value 
$cond 
$dbi Default DB_MASTER

Definition at line 242 of file DatabaseFunctions.php.

References $db, and wfGetDB().

wfSingleQuery ( sql,
dbi,
fname = '' 
)

Parameters:
$sql String: SQL query
$dbi 
$fname String: name of the php function calling
Returns:
Array: first row from the database

Definition at line 36 of file DatabaseFunctions.php.

References $db, $fname, $res, $row, $sql, and wfGetDB().

wfStrencode ( s,
dbi = DB_LAST 
)

Todo:
document function
See also:
Database::strencode()

Definition at line 379 of file DatabaseFunctions.php.

References $db, $s, and wfGetDB().

Referenced by rebuildRecentChangesTablePass2().

wfTableName ( name,
dbi = DB_LAST 
)

Get fully usable table name.

See also:
Database::tableName()

Definition at line 366 of file DatabaseFunctions.php.

References $db, $name, and wfGetDB().

wfUpdateArray ( table,
values,
conds,
fname = 'wfUpdateArray',
dbi = DB_MASTER 
)

See also:
Database::update()
Parameters:
$table String
$values 
$conds 
$fname String, default 'wfUpdateArray'
$dbi Default DB_MASTER
Returns:
Result of Database::update()) or false;
Todo:
document function

Definition at line 352 of file DatabaseFunctions.php.

References $conds, $db, $fname, and wfGetDB().

wfUseIndexClause ( index,
dbi = DB_SLAVE 
)

Todo:
document function
See also:
Database::useIndexClause()

Definition at line 405 of file DatabaseFunctions.php.

References $db, and wfGetDB().


Generated on Sat Sep 5 02:08:05 2009 for MediaWiki by  doxygen 1.5.9