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


PHP dbstuff::queries方法代码示例

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


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

示例1: init


//.........这里部分代码省略.........
                $room_prefix = '';
            }
        }
    }
    $tablepre = $gtablepre . $room_prefix;
    if ($room_prefix == '') {
        $wtablepre = $gtablepre;
    } else {
        $wtablepre = $gtablepre . $room_prefix[0];
    }
    //自动初始化表
    if ($room_prefix != '') {
        $result = $db->query("show tables like '{$wtablepre}winners';");
        if (!$db->num_rows($result)) {
            //某个非主房间是第一次使用,则创建表并初始化
            $db->query("create table if not exists {$wtablepre}winners like {$gtablepre}winners;");
        }
        $result = $db->query("show tables like '{$tablepre}game';");
        if (!$db->num_rows($result)) {
            //某个非主房间是第一次使用,则创建表并初始化
            $db->query("create table if not exists {$tablepre}game like {$gtablepre}game;");
            $result = $db->query("SELECT count(*) as cnt FROM {$tablepre}game");
            if (!$db->num_rows($result)) {
                $cnt = 0;
            } else {
                $zz = $db->fetch_array($result);
                $cnt = $zz['cnt'];
            }
            if ($cnt == 0) {
                $db->query("insert into {$tablepre}game (gamenum) values (0);");
            }
            $result = $db->query("SELECT count(*) as cnt FROM {$wtablepre}winners");
            if (!$db->num_rows($result)) {
                $cnt = 0;
            } else {
                $zz = $db->fetch_array($result);
                $cnt = $zz['cnt'];
            }
            if ($cnt == 0) {
                $db->query("insert into {$wtablepre}winners (gid) values (0);");
            }
            $sql = file_get_contents(GAME_ROOT . './gamedata/sql/reset.sql');
            $sql = str_replace("\r", "\n", str_replace(' bra_', ' ' . $tablepre, $sql));
            $db->queries($sql);
            $sql = file_get_contents(GAME_ROOT . './gamedata/sql/players.sql');
            $sql = str_replace("\r", "\n", str_replace(' bra_', ' ' . $tablepre, $sql));
            $db->queries($sql);
        }
    }
    //$errorinfo ? error_reporting(E_ALL) : error_reporting(0);
    date_default_timezone_set('Etc/GMT');
    //$now = time() + $moveutmin*60;
    global $now;
    $now = time() + $moveut * 3600 + $moveutmin * 60;
    global $sec, $min, $hour, $day, $month, $year, $wday;
    list($sec, $min, $hour, $day, $month, $year, $wday) = explode(',', date("s,i,H,j,n,Y,w", $now));
    //if($attackevasive) {
    //	include_once GAME_ROOT.'./include/security.inc.php';
    //}
    //COMBAT INFO INIT
    //已经一起做进数据库里了
    //global $hdamage,$hplayer,$noisetime,$noisepls,$noiseid,$noiseid2,$noisemode;
    //include GAME_ROOT.'./gamedata/combatinfo.php';
    //GAME INFO INIT
    global $now, $db, $tablepre;
    $result = $db->query("SELECT * FROM {$tablepre}game");
    global $gameinfo;
    $gameinfo = $db->fetch_array($result);
    foreach ($gameinfo as $key => $value) {
        global ${$key};
        ${$key} = $value;
    }
    if ($room_status == 2 && $gamestate == 0 && $room_prefix != '' && $room_prefix[0] == 's') {
        $db->query("UPDATE {$gtablepre}rooms SET status=1 WHERE roomid='" . substr($room_prefix, 1) . "'");
    }
    $arealist = explode(',', $arealist);
    global $cuser, $cpass;
    $cuser = ${$gtablepre . 'user'};
    $cpass = ${$gtablepre . 'pass'};
    //这里实在没办法,一堆文件都直接引用mode和command这两个来自input的变量,但又不能让所有文件都依赖input…… 只能恶心一下了……
    global $mode, $command, $___MOD_SRV;
    if ($___MOD_SRV) {
        global $___LOCAL_INPUT__VARS__mode, $___LOCAL_INPUT__VARS__command;
        global $___LOCAL_INPUT__VARS__INPUT_VAR_LIST;
        if (isset($___LOCAL_INPUT__VARS__INPUT_VAR_LIST['mode'])) {
            $mode = $___LOCAL_INPUT__VARS__INPUT_VAR_LIST['mode'];
        } else {
            $mode = $___LOCAL_INPUT__VARS__mode;
        }
        if (isset($___LOCAL_INPUT__VARS__INPUT_VAR_LIST['command'])) {
            $command = $___LOCAL_INPUT__VARS__INPUT_VAR_LIST['command'];
        } else {
            $command = $___LOCAL_INPUT__VARS__command;
        }
    } else {
        global $___LOCAL_INPUT__VARS__mode, $___LOCAL_INPUT__VARS__command;
        $mode = $___LOCAL_INPUT__VARS__mode;
        $command = $___LOCAL_INPUT__VARS__command;
    }
}
开发者ID:winddramon,项目名称:dts,代码行数:101,代码来源:init.php


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