Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: db_mysqli.php 4261 2008-11-03 01:11:33Z Tikitiki $
| * $Id: db_mysqli.php 4839 2010-03-29 23:52:54Z RyanGordon $
|
*/
class DB_MySQLi
| */
class DB_MySQLi
|
Zeile 185 | Zeile 185 |
---|
foreach($connections[$type] as $single_connection) { $connect_function = "mysqli_connect";
|
foreach($connections[$type] as $single_connection) { $connect_function = "mysqli_connect";
|
if($single_connection['pconnect'])
| $persist = ""; if($single_connection['pconnect'] && version_compare(PHP_VERSION, '5.3.0', '>='))
|
{
|
{
|
$connect_function = "mysqli_pconnect";
| $persist = "p:";
|
} $link = $type."_link";
| } $link = $type."_link";
|
Zeile 198 | Zeile 199 |
---|
list($hostname, $port) = explode(":", $single_connection['hostname'], 2); if($port) {
|
list($hostname, $port) = explode(":", $single_connection['hostname'], 2); if($port) {
|
$this->$link = @$connect_function($hostname, $single_connection['username'], $single_connection['password'], "", $port);
| $this->$link = @$connect_function($persist.$hostname, $single_connection['username'], $single_connection['password'], "", $port);
|
} else {
|
} else {
|
$this->$link = @$connect_function($single_connection['hostname'], $single_connection['username'], $single_connection['password']);
| $this->$link = @$connect_function($persist.$single_connection['hostname'], $single_connection['username'], $single_connection['password']);
|
}
$time_spent = $this->get_execution_time();
| }
$time_spent = $this->get_execution_time();
|
Zeile 261 | Zeile 262 |
---|
$master_success = @mysqli_select_db($this->read_link, $database) or $this->error("[READ] Unable to select database", $this->read_link); if($this->write_link) {
|
$master_success = @mysqli_select_db($this->read_link, $database) or $this->error("[READ] Unable to select database", $this->read_link); if($this->write_link) {
|
$slave_success = @mysqli_select_db($this->write_link, $database) or $this->error("[WRITE] Unable to slave database", $this->write_link);
| $slave_success = @mysqli_select_db($this->write_link, $database) or $this->error("[WRITE] Unable to select slave database", $this->write_link);
|
$success = ($master_success && $slave_success ? true : false); }
| $success = ($master_success && $slave_success ? true : false); }
|
Zeile 1044 | Zeile 1045 |
---|
function drop_index($table, $name) { $this->write_query("ALTER TABLE {$this->table_prefix}$table DROP INDEX $name");
|
function drop_index($table, $name) { $this->write_query("ALTER TABLE {$this->table_prefix}$table DROP INDEX $name");
|
| } /** * Checks to see if an index exists on a specified table * * @param string The name of the table. * @param string The name of the index. */ function index_exists($table, $index) { $index_exists = false; $query = $this->write_query("SHOW INDEX FROM {$this->table_prefix}{$table}"); while($ukey = $this->fetch_array($query)) { if($ukey['Key_name'] == $index) { $index_exists = true; break; } } if($index_exists) { return true; } return false;
|
} /**
| } /**
|