本文整理汇总了PHP中Main::db_fetch_row方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::db_fetch_row方法的具体用法?PHP Main::db_fetch_row怎么用?PHP Main::db_fetch_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::db_fetch_row方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_MEMBERS_DATA'], $GLOBALS['DBSTRUCT_L2J_CHARS_NAME'], $GLOBALS['DBSTRUCT_L2J_CHARS_LEVEL'], $GLOBALS['DBSTRUCT_L2J_CHARS_CLASS'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_CLAN'], Main::db_escape_string($clan_id, $GLOBALS['DB_GAME_SERVER'])), $GLOBALS['DB_GAME_SERVER']);
}
while ($members_data = Main::db_fetch_row($query)) {
$members_page_vars['member_name'] = htmlspecialchars($members_data[0]);
$members_page_vars['member_level'] = $members_data[1] ? $members_data[1] : '1';
$members_page_vars['member_class'] = Account::class_name($members_data[2]);
$acc_page_vars['members_list'] .= Template::load('styles/clan_members_list.html', $members_page_vars, 0);
}
$template_vars['acc_page'] = Template::load('clan_members.html', $acc_page_vars, 0);
} else {
if ($this->server_type == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CLAN_DATA'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_NAME'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_LEVEL'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_CASTLE'], '(' . sprintf($GLOBALS['DBQUERY_1_1N'], $GLOBALS['DBSTRUCT_L2OFF_ALLIANCE_NAME'], $GLOBALS['DBSTRUCT_L2OFF_ALLIANCE_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_ALLIANCE_ID'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_ALLY']) . ')', $GLOBALS['DBSTRUCT_L2OFF_USERDAT_NAME'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_USERDAT_ID'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_LEADER'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_USERDAT_CLAN'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_ID'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_ID'], Main::db_escape_string($clan_id, $GLOBALS['DB_GAME_SERVER'])), $GLOBALS['DB_GAME_SERVER']);
} else {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CLAN_DATA'], $GLOBALS['DBSTRUCT_L2J_CLAN_NAME'], $GLOBALS['DBSTRUCT_L2J_CLAN_LEVEL'], $GLOBALS['DBSTRUCT_L2J_CLAN_CASTLE'], $GLOBALS['DBSTRUCT_L2J_CLAN_ALLY'], $GLOBALS['DBSTRUCT_L2J_CHARS_NAME'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CHARS_ID'], $GLOBALS['DBSTRUCT_L2J_CLAN_LEADER'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CHARS_CLAN'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CLAN_ID'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'], $GLOBALS['DBSTRUCT_L2J_CLAN_ID'], Main::db_escape_string($clan_id, $GLOBALS['DB_GAME_SERVER'])), $GLOBALS['DB_GAME_SERVER']);
}
$clan_data = Main::db_fetch_row($query);
$acc_page_vars['clan_name'] = htmlspecialchars($clan_data[0]);
$acc_page_vars['clan_level'] = $clan_data[1] ? $clan_data[1] : '1';
$acc_page_vars['clan_leader'] = htmlspecialchars($clan_data[4]);
$acc_page_vars['clan_ally'] = $clan_data[3] ? htmlspecialchars($clan_data[3]) : $GLOBALS['LANG_NO_ALLY'];
$acc_page_vars['clan_castle'] = Account::castle_name($clan_data[2]);
$acc_page_vars['clan_members'] = $clan_data[5];
$acc_page_vars['clan_id'] = $clan_id;
$template_vars['acc_page'] = Template::load('clan_details.html', $acc_page_vars, 0);
}
} else {
$template_vars['acc_page'] = Template::load('errors.html', array('the_error' => $GLOBALS['LANG_ERROR_CLAN_ID']), 0);
}
}
} elseif (isset($_GET['select_char'])) {
$select_char_vars = array();
示例2: check_step
function check_step($step, &$vars, &$step_vars, &$errors_list, &$done_list)
{
if ($step == 1) {
$vars['active_agree'] = 'active';
} elseif ($step == 2) {
$vars['active_data'] = 'active';
$step_vars['val_h_gs'] = $GLOBALS['CONFIG_MYSQL_HOST_GS'];
$step_vars['val_h_ls'] = $GLOBALS['CONFIG_MYSQL_HOST_LS'];
$step_vars['val_u_gs'] = $GLOBALS['CONFIG_MYSQL_USER_GS'];
$step_vars['val_u_ls'] = $GLOBALS['CONFIG_MYSQL_USER_LS'];
$step_vars['val_d_gs'] = $GLOBALS['CONFIG_MYSQL_NAME_GS'];
$step_vars['val_d_ls'] = $GLOBALS['CONFIG_MYSQL_NAME_LS'];
if (isset($_POST['hostname_gs']) && isset($_POST['hostname_ls']) && isset($_POST['hostname_forum']) && isset($_POST['user_gs']) && isset($_POST['user_ls']) && isset($_POST['user_forum']) && isset($_POST['pass_gs']) && isset($_POST['pass_ls']) && isset($_POST['pass_forum']) && isset($_POST['data_gs']) && isset($_POST['data_ls']) && isset($_POST['data_forum'])) {
$host_gs = $step_vars['val_h_gs'] = htmlspecialchars($_POST['hostname_gs']);
$host_ls = $step_vars['val_h_ls'] = htmlspecialchars($_POST['hostname_ls']);
$host_forum = htmlspecialchars($_POST['hostname_forum']);
$user_gs = $step_vars['val_u_gs'] = htmlspecialchars($_POST['user_gs']);
$user_ls = $step_vars['val_u_ls'] = htmlspecialchars($_POST['user_ls']);
$user_forum = htmlspecialchars($_POST['user_forum']);
$pass_gs = htmlspecialchars($_POST['pass_gs']);
$pass_ls = htmlspecialchars($_POST['pass_ls']);
$pass_forum = htmlspecialchars($_POST['pass_forum']);
$data_gs = $step_vars['val_d_gs'] = htmlspecialchars($_POST['data_gs']);
$data_ls = $step_vars['val_d_ls'] = htmlspecialchars($_POST['data_ls']);
$data_forum = htmlspecialchars($_POST['data_forum']);
$gs_check = 0;
$ls_check = 0;
if (function_exists('sqlsrv_connect') && function_exists('sqlsrv_close')) {
if (sqlsrv_connect($host_gs, array('Database' => $data_gs, 'UID' => $user_gs, 'PWD' => $pass_gs))) {
$gs_check = 1;
}
if (sqlsrv_connect($host_ls, array('Database' => $data_ls, 'UID' => $user_ls, 'PWD' => $pass_ls))) {
$ls_check = 1;
}
@sqlsrv_close();
} elseif (function_exists('mssql_connect') && function_exists('mssql_select_db') && function_exists('mssql_close')) {
if (@mssql_connect($host_gs, $user_gs, $pass_gs) && @mssql_select_db($data_gs)) {
$gs_check = 1;
}
if (@mssql_connect($host_ls, $user_ls, $pass_ls) && @mssql_select_db($data_ls)) {
$ls_check = 1;
}
@mssql_close();
}
if ($gs_check == 1 && $ls_check == 1) {
$server_type = 1;
} else {
if (function_exists('mysql_connect') && function_exists('mysql_select_db') && function_exists('mysql_close')) {
if (@mysql_connect($host_gs, $user_gs, $pass_gs) && @mysql_select_db($data_gs)) {
$gs_check = 1;
}
if (@mysql_connect($host_ls, $user_ls, $pass_ls) && @mysql_select_db($data_ls)) {
$ls_check = 1;
}
}
if ($gs_check == 1 && $ls_check == 1) {
$server_type = 2;
}
@mysql_close();
}
if (!isset($server_type)) {
$errors_list .= 'Can\'t establish a connection with those details!';
} else {
$dbt = $server_type == 1 ? 'MSSQL' : 'MYSQL';
if (Configs::update_configs(array('CONFIG_SERVER_TYPE' => '\'' . $server_type . '\''), 'main') && Configs::update_configs(array('CONFIG_' . $dbt . '_HOST_GS' => '\'' . $host_gs . '\'', 'CONFIG_' . $dbt . '_HOST_LS' => '\'' . $host_ls . '\'', 'CONFIG_' . $dbt . '_USER_GS' => '\'' . $user_gs . '\'', 'CONFIG_' . $dbt . '_USER_LS' => '\'' . $user_ls . '\'', 'CONFIG_' . $dbt . '_PASS_GS' => '\'' . $pass_gs . '\'', 'CONFIG_' . $dbt . '_PASS_LS' => '\'' . $pass_ls . '\'', 'CONFIG_' . $dbt . '_NAME_GS' => '\'' . $data_gs . '\'', 'CONFIG_' . $dbt . '_NAME_LS' => '\'' . $data_ls . '\''), 'connection')) {
++$_SESSION['DE_INSTALL_STEP'];
$done_list .= 'Database Configuration step completed!';
} else {
$errors_list .= 'Error while updating configs.Please report it on forum: <a style="color:#181818;" href="http://dragoneyecms.com">www.dragoneyecms.com</a>';
}
}
}
} elseif ($step == 3) {
if (isset($_GET['q']) && isset($_GET['r']) && isset($_GET['p'])) {
if ($GLOBALS['CONFIG_SERVER_TYPE'] == 1) {
if ($GLOBALS['CONFIG_USE_SQLSRV'] && extension_loaded('sqlsrv')) {
$GLOBALS['DB_GAME_SERVER_LINK'] = sqlsrv_connect($GLOBALS['CONFIG_MSSQL_HOST_GS'], array('Database' => $GLOBALS['CONFIG_MSSQL_NAME_GS'], 'UID' => $GLOBALS['CONFIG_MSSQL_USER_GS'], 'PWD' => $GLOBALS['CONFIG_MSSQL_PASS_GS']));
$GLOBALS['DB_LOGIN_SERVER_LINK'] = sqlsrv_connect($GLOBALS['CONFIG_MSSQL_HOST_LS'], array('Database' => $GLOBALS['CONFIG_MSSQL_NAME_LS'], 'UID' => $GLOBALS['CONFIG_MSSQL_USER_LS'], 'PWD' => $GLOBALS['CONFIG_MSSQL_PASS_LS']));
} else {
$GLOBALS['DB_GAME_SERVER_LINK'] = @mssql_pconnect($GLOBALS['CONFIG_MSSQL_HOST_GS'], $GLOBALS['CONFIG_MSSQL_USER_GS'], $GLOBALS['CONFIG_MSSQL_PASS_GS']);
$GLOBALS['DB_LOGIN_SERVER_LINK'] = @mssql_pconnect($GLOBALS['CONFIG_MSSQL_HOST_LS'], $GLOBALS['CONFIG_MSSQL_USER_LS'], $GLOBALS['CONFIG_MSSQL_PASS_LS']);
@mssql_select_db($GLOBALS['CONFIG_MSSQL_NAME_GS'], $GLOBALS['DB_GAME_SERVER_LINK']);
$GLOBALS['CURRENT_DB_P'] = 'S';
$GLOBALS['CURRENT_DB'] = '1';
}
$link = $_GET['p'] == 1 ? 1 : 2;
if ($_GET['r'] == '0') {
if (Main::db_result(Main::db_query(sprintf('IF OBJECT_ID (N\'%s\', N\'U\') IS NOT NULL SELECT 1 AS result ELSE SELECT 0 AS result', $_GET['q']), $link), 0) == 1) {
exit('1');
}
} else {
$qry = Main::db_query(sprintf('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = \'%s\'', $_GET['r']), $link);
while ($row = Main::db_fetch_row($qry)) {
if ($row[0] == $_GET['q']) {
exit('1');
}
}
}
if ($GLOBALS['CONFIG_USE_SQLSRV'] && extension_loaded('sqlsrv')) {
@sqlsrv_close($GLOBALS['DB_GAME_SERVER_LINK']);
//.........这里部分代码省略.........
示例3: header
header('Content-type: image/png');
imagecreatefrompng($image_cache);
imagepng(imagecreatefrompng($image_cache));
} else {
if ($GLOBALS['CONFIG_SERVER_TYPE'] == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_1_1'], $GLOBALS['DBSTRUCT_L2OFF_USERACC_SIGNATURE'], $GLOBALS['DBSTRUCT_L2OFF_USERACC_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERACC_ACCOUNT'], Main::db_escape_string($acc_name, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
} else {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_1_1'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_SIGNATURE'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_TABLE'], $GLOBALS['DBSTRUCT_L2J_ACCOUNTS_NAME'], Main::db_escape_string($acc_name, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
}
if (Main::db_result($query, 0) == 1 || $this->logged && strcasecmp($acc_name, $acc->account_username) == 0) {
if ($GLOBALS['CONFIG_SERVER_TYPE'] == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_SIGNATURE_ACC'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_ONLINE_TIME'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_PVP'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_PK'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_ACC'], Main::db_escape_string($acc_name, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_GAME_SERVER']);
} else {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_SIGNATURE_ACC'], $GLOBALS['DBSTRUCT_L2J_CHARS_ONLINE_TIME'], $GLOBALS['DBSTRUCT_L2J_CHARS_PVP'], $GLOBALS['DBSTRUCT_L2J_CHARS_PK'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_ACC'], Main::db_escape_string($acc_name, $GLOBALS['DB_LOGIN_SERVER'])), $GLOBALS['DB_LOGIN_SERVER']);
}
$acc_data = Main::db_fetch_row($query);
header('Content-type: image/png');
$image_path = sep_path(CMS_DIR . '/templates/' . Template::used_template() . '/' . $GLOBALS['CONFIG_TEMPLATE_IMAGES'] . '/account_signature.png');
$the_image = imagecreatefrompng($image_path);
$color_1 = imagecolorallocate($the_image, 234, 234, 174);
$color_2 = imagecolorallocate($the_image, 255, 255, 255);
$color_3 = imagecolorallocate($the_image, 151, 162, 120);
$shadow_color = imagecolorallocate($the_image, 0, 0, 0);
$shading_color = imagecolorallocatealpha($the_image, 0, 0, 0, 100);
draw_text($the_image, 17, 15, 23, $color_1, 110, $GLOBALS['CONFIG_WEBSITE_NAME']);
draw_text($the_image, 14, 20, 50, $color_2, 120, $GLOBALS['LANG_USER']);
draw_text($the_image, 10, 65, 65, $color_2, 120, '- ' . $acc_name);
draw_text($the_image, 14, 20, 85, $color_2, 120, $GLOBALS['LANG_ON_TIME']);
draw_text($the_image, 10, 20, 100, $color_2, 120, '- ' . gmstrftime(bcdiv($acc_data[0], 86400) . ' ' . $GLOBALS['LANG_DAYS'] . ' %H ' . $GLOBALS['LANG_HOURS'] . ' %M ' . $GLOBALS['LANG_MINS'], $acc_data[0]));
draw_text($the_image, 14, 300, 35, $color_2, 120, $GLOBALS['LANG_PVP']);
draw_text($the_image, 10, 345, 50, $color_2, 120, '- ' . $acc_data[1]);
示例4: array
$GLOBALS['the_status'] = $GLOBALS['LANG_PAGE_LOGGED'];
} else {
$stat_page_vars = array();
$the_stat_vars = array();
$the_results = array();
$cache_file = sep_path(CMS_DIR . '/cache/castles.txt');
if ($GLOBALS['CONFIG_STATS_CASTLE_CACHE'] && file_exists($cache_file) && time() - filemtime($cache_file) < $GLOBALS['CONFIG_STATS_CASTLE_CACHE']) {
$the_results = unserialize(file_get_contents($cache_file));
} else {
if ($GLOBALS['CONFIG_SERVER_TYPE'] == 1) {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CASTLES'], $GLOBALS['DBSTRUCT_L2OFF_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_CASTLE_ID'], $GLOBALS['DBSTRUCT_L2OFF_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_CASTLE_DATE'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_NAME'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_CASTLE'], $GLOBALS['DBSTRUCT_L2OFF_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_CASTLE_ID'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_NAME'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_USERDAT_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_USERDAT_ID'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_LEADER'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'], $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_PLEDGE_CASTLE'], $GLOBALS['DBSTRUCT_L2OFF_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2OFF_CASTLE_ID'], $GLOBALS['DBSTRUCT_L2OFF_CASTLE_TABLE']), $GLOBALS['DB_GAME_SERVER']);
} else {
$query = Main::db_query(sprintf($GLOBALS['DBQUERY_CASTLES'], $GLOBALS['DBSTRUCT_L2J_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CASTLE_ID'], $GLOBALS['DBSTRUCT_L2J_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CASTLE_DATE'], $GLOBALS['DBSTRUCT_L2J_CLAN_NAME'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CLAN_CASTLE'], $GLOBALS['DBSTRUCT_L2J_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CASTLE_ID'], $GLOBALS['DBSTRUCT_L2J_CHARS_NAME'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'], $GLOBALS['DBSTRUCT_L2J_CHARS_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CHARS_ID'], $GLOBALS['DBSTRUCT_L2J_CLAN_LEADER'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'], $GLOBALS['DBSTRUCT_L2J_CLAN_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CLAN_CASTLE'], $GLOBALS['DBSTRUCT_L2J_CASTLE_TABLE'] . '.' . $GLOBALS['DBSTRUCT_L2J_CASTLE_ID'], $GLOBALS['DBSTRUCT_L2J_CASTLE_TABLE']), $GLOBALS['DB_GAME_SERVER']);
}
$i = 1;
while ($castle_data = Main::db_fetch_row($query)) {
$the_results[] = $castle_data;
}
if ($GLOBALS['CONFIG_STATS_CASTLE_CACHE']) {
file_put_contents($cache_file, serialize($the_results));
}
}
$stat_page_vars['the_stat'] = '';
$i = 1;
foreach ($the_results as $castle_data) {
$the_stat_vars['the_rank'] = $i;
$the_stat_vars['castle_name'] = Account::castle_name($castle_data[0]);
$the_stat_vars['castle_date'] = $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? date($GLOBALS['CONFIG_DATE_FORMAT'], $castle_data[1]) : date($GLOBALS['CONFIG_DATE_FORMAT'], $castle_data[1] / 1000);
$the_stat_vars['castle_owner'] = $castle_data[2] ? $castle_data[2] : $GLOBALS['LANG_NO_OWNER'];
$the_stat_vars['castle_owner_name'] = $castle_data[3] ? $castle_data[3] : ' - ';
++$i;