vB_DatabaseClass to interface with a database
This class also handles data replication between a master and slave(s) servers
Located in /includes/class_core.php (line 78)
| Class | Description |
|---|---|
vB_Database_MySQLi
|
Class to interface with a MySQL 4.1 database |
vB_Database_Explain
|
Class to interface with a database |
vB_Database_Slave
|
Class to handle interacting with a slave (and master) DB. Slave DBs are used for some reads. Master DBs are used for all writes and time-sensitive reads. |
none
connect
(string $database, string $w_servername, integer $w_port, string $w_username, string $w_password, [boolean $w_usepconnect = false], [string $r_servername = ''], [integer $r_port = 3306], [string $r_username = ''], [string $r_password = ''], [boolean $r_usepconnect = false], [string $configfile = ''], [string $charset = ''])
boolean
db_connect
(string $servername, integer $port, string $username, string $password, boolean $usepconnect, [string $configfile = ''], [string $charset = ''])
string
$appname
= 'vBulletin' (line 132)
Full name of the system
string
$appshortname
= 'vBulletin' (line 139)
Short name of the system
string
$connection_master
= null (line 153)
Link variable. The connection to the master/write server.
string
$connection_recent
= null (line 167)
Link variable. The connection last used.
string
$connection_slave
= null (line 160)
Link variable. The connection to the slave/read server(s).
string
$database
= null (line 146)
Database name
integer
$errno
= '' (line 209)
The error number of the most recent database error message
string
$error
= '' (line 202)
The text of the most recent database error message
array
$fetchtypes
= array(Array of constants for use in fetch_array
array
$functions
= array(Array of function names, mapping a simple name to the RDBMS specific function name
bool
$locked
= false (line 223)
Track lock status of tables. True if a table lock has been issued
integer
$maxpacket
= 0 (line 216)
SQL Query String
boolean
$multiserver
= false (line 174)
Whether or not we will be using different connections for read and write queries
integer
$querycount
= 0 (line 230)
Number of queries executed
vB_Registry
$registry
= null (line 114)
The vBulletin registry object
boolean
$reporterror
= true (line 195)
Whether or not to show and halt on database errors
array
$shutdownqueries
= array() (line 181)
Array of queries to be executed when the script shuts down
string
$sql
= '' (line 188)
The contents of the most recent SQL query string.
Constructor vB_Database (line 238)
Constructor. If x_real_escape_string() is available, switches to use that function over x_escape_string().
affected_rows (line 830)
Retuns the number of rows affected by the most recent insert/replace/update query
client_encoding (line 687)
Returns the name of the character set
close (line 697)
Closes the connection to the database server
connect (line 269)
Connects to the specified database server(s)
data_seek (line 807)
Moves the internal result pointer within a query result set
db_connect (line 301)
Initialize database connection(s)
Connects to the specified master database server, and also to the slave server if it is specified
errno (line 903)
Returns the numerical value of the error message from previous database operation
error (line 885)
Returns the text of the error message from previous database operation
escape_string (line 709)
Escapes a string to make it safe to be inserted into an SQL query
escape_string_like (line 728)
Escapes a string using the appropriate escape character for the RDBMS for use in LIKE conditions
execute_query (line 403)
Executes an SQL query through the specified connection
fetch_array (line 770)
Fetches a row from a query result and returns the values from that row as an array
The value of $type defines whether the array will have numeric or associative keys, or both
fetch_field (line 794)
Fetches a row information from a query result and returns the values from that row as an array
fetch_row (line 782)
Fetches a row from a query result and returns the values from that row as an array with numeric keys
field_name (line 667)
Returns the name of a field from within a query result set
force_sql_mode (line 379)
Forces the sql_mode varaible to a specific mode. Certain modes may be incompatible with vBulletin. Applies to MySQL 4.1+.
found_rows (line 505)
Executes a FOUND_ROWS query to get the results of SQL_CALC_FOUND_ROWS
free_result (line 819)
Frees all memory associated with the specified query result
halt (line 939)
Halts execution of the entire system and displays an error message
hide_errors (line 927)
Switches database error display OFF
insert_id (line 677)
Returns the ID of the item just inserted into an auto-increment field
insert_multiple (line 564)
Executes an INSERT or REPLACE query with multiple values, splitting large queries into manageable chunks based on $this->maxpacket
lock_tables (line 843)
Lock tables
num_fields (line 654)
Returns the number of fields contained within a query result set
num_rows (line 642)
Returns the number of rows contained within a query result set
query (line 477)
Executes an SQL query, using either the write connection
query_first (line 491)
Executes a data-reading SQL query, then returns an array of the data from the first row from the result set
query_first_slave (line 519)
Executes a data-reading SQL query against the slave server, then returns an array of the data from the first row from the result set
query_insert (line 535)
Executes an INSERT INTO query, using extended inserts if possible
query_read (line 447)
Executes a data-reading SQL query through the 'master' database connection we don't know if the 'read' database is up to date so be on the safe side
query_read_slave (line 461)
Executes a data-reading SQL query through the 'slave' database connection
query_replace (line 550)
Executes a REPLACE INTO query, using extended inserts if possible
query_write (line 432)
Executes a data-writing SQL query through the 'master' database connection
select_db (line 340)
Selects a database to use
select_db_wrapper (line 368)
Simple wrapper for select_db(), to allow argument order changes
show_errors (line 919)
Switches database error display ON
shutdown_query (line 621)
Registers an SQL query to be executed at shutdown time. If shutdown functions are disabled, the query is run immediately.
sql_prepare (line 740)
Takes a piece of data and prepares it to be put into an SQL query by adding quotes etc.
unlock_tables (line 870)
Unlock tables
Documentation generated on Fri, 09 May 2008 09:00:56 -0500 by phpDocumentor 1.4.1