Class BPDB_Multi

Description

Located in /includes/class.bpdb-multi.php (line 10)

BPDB
   |
   --BPDB_Multi
Variable Summary
array $dbhs
mixed $db_servers
mixed $db_tables
mixed $last_table
Method Summary
BPDB_Multi __construct ()
void add_db_server (string $ds, [array $args = null])
void add_db_table (string $ds, string $table)
resource &db_connect ([string $query = ''])
string get_table_from_query (string $q)
string set_prefix (string $prefix, [false|array $tables = false])
Variables
array $dbhs = array() (line 15)

Associative array (dbhname => dbh) for established mysql connections

mixed $db_servers = array() (line 20)
mixed $db_tables = array() (line 19)
mixed $last_table = '' (line 18)
mixed $_force_dbhname = false (line 17)

Inherited Variables

Inherited from BPDB

BPDB::$last_error
BPDB::$real_escape
Methods
Constructor __construct (line 24)
BPDB_Multi __construct ()

Redefinition of:
BPDB::__construct()
PHP5 style constructor
add_db_server (line 172)

Add a database server's information. Does not automatically connect.

void add_db_server (string $ds, [array $args = null])
  • string $ds: Dataset: the name of the dataset.
  • array $args: name => string DB name (required) user => string DB user (optional: false) password => string DB user password (optional: false) host => string DB hostname (optional: 'localhost') charset => string DB default charset. Used in a SET NAMES query. (optional) collate => string DB default collation. If charset supplied, optionally added to the SET NAMES query (optional)
add_db_table (line 193)

Maps a table to a dataset.

void add_db_table (string $ds, string $table)
  • string $ds: Dataset: the name of the dataset.
  • string $table
db_connect (line 39)

Figure out which database server should handle the query, and connect to it.

  • return: mysql database connection
resource &db_connect ([string $query = ''])
  • string $query: query

Redefinition of:
BPDB::db_connect()
Figure out which database server should handle the query, and connect to it.
get_table_from_query (line 117)

Find the first table name referenced in a query

  • return: table
string get_table_from_query (string $q)
  • string $q: query
set_prefix (line 89)

Sets the prefix of the database tables

  • return: the previous prefix (mostly only meaningful if all $table parameter was false)
string set_prefix (string $prefix, [false|array $tables = false])
  • string $prefix: prefix
  • false|array $tables: tables (optional: false) table identifiers are array keys array values empty: set prefix: array( 'posts' => false, 'users' => false, ... ) string: set to that array value: array( 'posts' => 'my_posts', 'users' => 'my_users' ) array: array[0] is DB identifier, array[1] is table name: array( 'posts' => array( 'global', 'my_posts' ), 'users' => array( 'users', 'my_users' ) ) OR array values (with numeric keys): array( 'posts', 'users', ... )

Redefinition of:
BPDB::set_prefix()
Sets the table prefix for the WordPress tables.

Inherited Methods

Inherited From BPDB

BPDB::__construct()
BPDB::BPDB()
BPDB::bail()
BPDB::check_database_version()
BPDB::db_connect()
BPDB::db_connect_host()
BPDB::db_version()
BPDB::escape()
BPDB::escape_by_ref()
BPDB::escape_deep()
BPDB::flush()
BPDB::get_caller()
BPDB::get_col()
BPDB::get_col_info()
BPDB::get_error()
BPDB::get_results()
BPDB::get_row()
BPDB::get_var()
BPDB::has_cap()
BPDB::hide_errors()
BPDB::insert()
BPDB::prepare()
BPDB::print_error()
BPDB::query()
BPDB::select()
BPDB::set_prefix()
BPDB::show_errors()
BPDB::supports_collation()
BPDB::suppress_errors()
BPDB::timer_start()
BPDB::timer_stop()
BPDB::update()
BPDB::_escape()
BPDB::_init()
BPDB::_real_escape()
BPDB::_weak_escape()
BPDB::__destruct()

Documentation generated on Fri, 18 May 2012 01:33:41 +0100 by phpDocumentor 1.4.3