public function test_db2() { //$conn=$this->conn; debug(); get_db_config("esirs")->search_record("air_port"); //$this->connf["esirs"]->search_record("airport")); }
/** * ishot = 0 内网 * ishot = 1 内网 */ function get_db_link() { $isHost = 0; $isWhat = 0; if (strstr($_SERVER['SERVER_NAME'], "limaogame.com")) { $isHost = 1; } $db = get_db_config($isHost); if ($isHost == 1) { $config['hostname'] = $db[$isWhat]['host']; $config['username'] = $db[$isWhat]['user']; $config['password'] = $db[$isWhat]['password']; } if ($isHost == 0) { $config['hostname'] = $db[$isWhat]['host']; $config['username'] = $db[$isWhat]['user']; $config['password'] = $db[$isWhat]['password']; } $config['database'] = ""; $config['dbdriver'] = "mysql"; $config['dbprefix'] = ""; $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; $config['cache_on'] = FALSE; $config['cachedir'] = ""; $config['char_set'] = "utf8"; $config['dbcollat'] = "utf8_general_ci"; return $config; }
if (PHP_VERSION < '4.0.6') { $msg .= "<SPAN class=err>{$lang['step2PHPVersionTooLowTip']}</span><br /><br />"; $nextAccess = 0; $extend .= '{O}' . $lang['step2PHPVersionTooLowTip'] . "\n"; } if (!function_exists('mysql_connect')) { $msg .= "<SPAN class=err>{$lang['step3MySQLExtErrorTip']}</span><br /><br />"; $nextAccess = 0; $extend .= '{P}' . $lang['step3MySQLExtErrorTip'] . "\n"; } if ($msg) { $str = "<p>" . $msg . "</p>"; } if ($nextAccess == 1) { // 自动填充数据库信息 $db_config = get_db_config(); $str = "<div id=\"tips\">{$lang['step3Tip']}</div>"; $str .= "<div id=\"wrapper\">\r\n\t<div class=\"col\">\r\n\t<h3>{$lang['commonSetupOption']} {$lang['commonSetupParameterValue']} {$lang['commonSetupComment']}</h3>\r\n\t<p><span class=\"red\">{$lang['step3MySqlHost']}: </span> <input name=\"dbhost\" value=\"" . $db_config['dbhost'] . "\" type=\"text\" size=\"20\"/> {$lang['step3MySqlHostComment']}</p>\r\n\t<p>{$lang['step3MySqlUser']}: <input name=\"dbuser\" value=\"" . $db_config['dbuser'] . "\" type=\"text\" size=\"20\" maxlength=\"16\"/> {$lang['step3MySqlUserComment']}</p>\r\n\t<p>{$lang['step3MySqlPass']}: <input name=\"dbpassword\" value=\"" . $db_config['dbpassword'] . "\" type=\"password\" size=\"20\"/> {$lang['step3MySqlPassComment']}</p>\r\n\t<p>{$lang['step3MySqlDBName']}: <input name=\"dbname\" value=\"" . $db_config['dbname'] . "\" type=\"text\" size=\"20\" onblur=\"checkConfig(this)\" maxlength=\"64\"/> {$lang['step3MySqlDBNameComment']}</p>\r\n\t<p><span class=\"red\">{$lang['step3MySqlDBTablePrefix']}:</span> <input name=\"table_prefix\" value=\"" . $db_config['table_prefix'] . "\" type=\"text\" size=\"20\" onblur=\"checkConfig(this)\" maxlength=\"30\"/> {$lang['step3MySqlDBTablePrefixComment']}</p>\r\n\t</div></div><input type='hidden' name='saveconfig' value='1'/>"; } $prevStep = $prevStep - 1; $isone = true; } break; case 4: require_once HDWIKI_ROOT . '/config.php'; if (!@mysql_connect(DB_HOST, DB_USER, DB_PW)) { $msg .= '<SPAN class=err>' . $lang['step3NoConnDB'] . '</span><br/>'; $nextAccess = 0; $extend .= '{Q}' . $lang['step3NoConnDB'] . "\n"; } else { $curr_mysql_version = mysql_get_server_info();