/** * @param string|null $connection_name * @param string $statement * @param null $fields * @return int * @throws Exception */ public static function execute($connection_name = null, $statement, $fields = null) { $db = ($connection_name) ? db_con::getDbCon($connection_name) : DB::getInstance(); if (!isset(self::$sqlCache[$statement])) self::$sqlCache[$statement] = $db->prepare($statement); $sth = self::$sqlCache[$statement]; foreach($fields as $key => &$value) { $sth->bindParam($key, $value, self::get_type($value)); } $sth->execute(); $lastInsertId = (int) $db->lastInsertId(); unset($sth); unset($db); return $lastInsertId; }
global $db_mantis_dbname; global $db_mantis_port; global $db_mantis_username; global $db_mantis_pwd; // Create db connections $auth_db = new db( "{$db_auth_type}:host={$db_auth_host};port={$db_auth_port};dbname={$db_auth_dbname};charset=utf8", $db_auth_username, $db_auth_pwd, array() ); $phpbb_db = new db( "{$dbms}:host={$dbhost};port={$dbport};dbname={$dbname};charset=utf8", $dbuser, $phpbb_db_pw, array() ); $mantis_db = new db( "{$db_mantis_type}:host={$db_mantis_host};port={$db_mantis_port};dbname={$db_mantis_dbname};charset=utf8", $db_mantis_username, $db_mantis_pwd, array() ); // Assisgn connections db_con::setDbCon($auth_db, "auth_db"); db_con::setDbCon($phpbb_db, "phpbb_db"); db_con::setDbCon($mantis_db, "mantis_db");
$dbuser, $phpbb_db_pw, array() ); $mantis_db = new db( "{$db_mantis_type}:host={$db_mantis_host};port={$db_mantis_port};dbname={$db_mantis_dbname};charset=utf8", $db_mantis_username, $db_mantis_pwd, array() ); /* $lol_db = new db( "{$db_lol_type}:host={$db_lol_host};port={$db_lol_port};dbname={$db_lol_username};charset=utf8", $db_lol_username, $db_lol_pwd, array() ); */ // Assign connections db_con::setDbCon($auth_db, "auth_db"); db_con::setDbCon($char_db, "char_db"); db_con::setDbCon($world_db, "world_db"); db_con::setDbCon($phpbb_db, "phpbb_db"); // db_con::setDbCon($lol_db, "lolforum"); // Get PHPBB Infos new get_phpbb_info(); $roa_output_html = getfunctionOutput();