当前位置: 首页>>代码示例>>PHP>>正文


PHP sql_db::sql_fetch_assoc方法代码示例

本文整理汇总了PHP中sql_db::sql_fetch_assoc方法的典型用法代码示例。如果您正苦于以下问题:PHP sql_db::sql_fetch_assoc方法的具体用法?PHP sql_db::sql_fetch_assoc怎么用?PHP sql_db::sql_fetch_assoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sql_db的用法示例。


在下文中一共展示了sql_db::sql_fetch_assoc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    } else {
        $module_config[$row['module']][$row['config_name']] = $row['config_value'];
    }
}
if (!isset($global_config['upload_checking_mode']) or !in_array($global_config['upload_checking_mode'], array("mild", "lite", "none"))) {
    $global_config['upload_checking_mode'] = "strong";
}
define('UPLOAD_CHECKING_MODE', $global_config['upload_checking_mode']);
//Cap nhat Country moi
if (!empty($newCountry)) {
    if ($db->sql_query("INSERT INTO `" . $db_config['prefix'] . "_ipcountry` VALUES (" . $newCountry['ip_from'] . ", " . $newCountry['ip_to'] . ", '" . $newCountry['code'] . "', '" . $newCountry['ip_file'] . "', " . NV_CURRENTTIME . ")")) {
        $time_del = NV_CURRENTTIME - 604800;
        $db->sql_query("DELETE FROM `" . $db_config['prefix'] . "_ipcountry` WHERE `ip_file`='" . $newCountry['ip_file'] . "' AND `country`='ZZ' AND `time` < " . $time_del);
        $result = $db->sql_query("SELECT `ip_from`, `ip_to`, `country` FROM `" . $db_config['prefix'] . "_ipcountry` WHERE `ip_file`='" . $newCountry['ip_file'] . "'");
        $array_ip_file = array();
        while ($row = $db->sql_fetch_assoc($result)) {
            $array_ip_file[] = $row['ip_from'] . " => array(" . $row['ip_to'] . ", '" . $row['country'] . "')";
        }
        file_put_contents(NV_ROOTDIR . "/" . NV_DATADIR . "/ip_files/" . $newCountry['ip_file'] . ".php", "<?php\n\n\$ranges = array(" . implode(', ', $array_ip_file) . ");\n\n?>", LOCK_EX);
    }
    unset($newCountry, $time_del, $array_ip_file, $result, $row);
}
if ($global_config['is_url_rewrite']) {
    $check_rewrite_file = nv_check_rewrite_file();
    if ($check_rewrite_file) {
        require NV_ROOTDIR . "/includes/rewrite.php";
    } else {
        require NV_ROOTDIR . "/includes/rewrite_index.php";
    }
    if (preg_match("/^" . nv_preg_quote(NV_BASE_SITEURL . "index.php?") . "/i", $_SERVER['REQUEST_URI'])) {
        $url_rewrite = nv_url_rewrite($_SERVER['REQUEST_URI'], true);
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:mainfile.php

示例2: array

 $db_config['num_table'] = 0;
 $db_config['create_db'] = 1;
 if (!empty($db_config['dbhost']) and !empty($db_config['dbname']) and !empty($db_config['dbuname']) and !empty($db_config['prefix'])) {
     $db_config['dbuname'] = preg_replace(array("/[^a-z0-9]/", '/[\\_]+/', "/^[\\_]+/", "/[\\_]+\$/"), array("_", "_", "", ""), strtolower($db_config['dbuname']));
     $db_config['dbname'] = preg_replace(array("/[^a-z0-9]/", '/[\\_]+/', "/^[\\_]+/", "/[\\_]+\$/"), array("_", "_", "", ""), strtolower($db_config['dbname']));
     $db_config['prefix'] = preg_replace(array("/[^a-z0-9]/", '/[\\_]+/', "/^[\\_]+/", "/[\\_]+\$/"), array("_", "_", "", ""), strtolower($db_config['prefix']));
     $db = new sql_db($db_config);
     if (!empty($db->error)) {
         $db_config['error'] = !empty($db->error['user_message']) ? $db->error['user_message'] : $db->error['message'];
     } else {
         $tables = array();
         $result = $db->sql_query("SHOW TABLE STATUS LIKE '" . $db_config['prefix'] . "\\_%'");
         $num_table = intval($db->sql_numrows($result));
         if ($num_table > 0) {
             if ($db_config['db_detete'] == 1) {
                 while ($item = $db->sql_fetch_assoc($result)) {
                     $db->sql_query("DROP TABLE `" . $item['Name'] . "`");
                 }
                 $num_table = 0;
             } else {
                 $db_config['error'] = $lang_module['db_err_prefix'];
             }
         }
         $db_config['num_table'] = $num_table;
         if ($num_table == 0) {
             nv_save_file_config();
             $db_config['error'] = "";
             $sql_create_table = array();
             //cai dat du lieu cho he thong
             require_once NV_ROOTDIR . "/install/data.php";
             foreach ($sql_create_table as $query) {
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:index.php


注:本文中的sql_db::sql_fetch_assoc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。