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


PHP DBFactory::getDBQuery方法代码示例

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


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

示例1: update034

/**
 * @package EDK
 */
function update034()
{
    global $url, $smarty;
    //Checking if this Update already done
    if (CURRENT_DB_UPDATE < "034") {
        if (is_null(config::get('034updatestatus'))) {
            config::set('034updatestatus', 0);
        }
        $qry = DBFactory::getDBQuery(true);
        if (config::get('034updatestatus') < 1) {
            $qry->execute("SHOW COLUMNS FROM kb3_invtypes LIKE 'radius'");
            if ($qry->recordCount()) {
                $sql = "ALTER TABLE `kb3_invtypes` DROP COLUMN `radius` ";
                $qry->execute($sql);
            }
        }
        config::set("DBUpdate", "034");
        $qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '034' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '034'");
        config::del("034updatestatus");
        $smarty->assign('refresh', 1);
        $smarty->assign('content', "Update 034 completed.");
        $smarty->display('update.tpl');
        die;
    }
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:28,代码来源:update.php

示例2: ec_update_value

/**
 *	Wrapper to do all to work.  Updates the items table based on the cached or live data.
 */
function ec_update_value($item_id)
{
    $query = DBFactory::getDBQuery();
    // Don't try if we can't open URLs with fopen.
    // Do to!
    //    if (1 != function_exists('curl_init')) {
    //            return;
    //    }
    // Don't try if the item id isn't an integer.
    if (!is_numeric($item_id)) {
        return;
    }
    // Verify we have a sync table to use.
    verify_sync_table();
    // The destroyed items etc feed in the -internal- killboard item ID.
    // EVE Central needs the external ID if we have it.
    $query->execute("SELECT typeID FROM kb3_invtypes WHERE typeID={$item_id}");
    $data = $query->getRow();
    $e_item_id = $data['typeID'];
    // Don't try if the item id isn't an integer or it's 0.
    if (!is_numeric($e_item_id) or 0 == $e_item_id) {
        return;
    }
    file_put_contents(KB_CACHEDIR . '/evecentral/activity.log', "Request for {$item_id} -> {$e_item_id}\n", FILE_APPEND);
    $value = ec_get_value($e_item_id);
    if (-99 != $value) {
        $query->execute("update kb3_item_price set price='{$value}' WHERE typeID={$item_id}");
        return true;
    } else {
        file_put_contents(KB_CACHEDIR . '/evecentral/activity.log', "Failed to find it.\n", FILE_APPEND);
    }
    return false;
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:36,代码来源:eve_central_sync.php

示例3: update014

function update014()
{
    global $url, $smarty;
    //Checking if this Update already done
    if (CURRENT_DB_UPDATE < "014") {
        if (is_null(config::get('014updatestatus'))) {
            config::set('014updatestatus', 0);
        }
        $qry = DBFactory::getDBQuery(true);
        if (config::get('014updatestatus') < 1) {
            // Add killmail summary. time, hash, trust.
            $sql = 'CREATE TABLE IF NOT EXISTS `kb3_mails` (
  `kll_id` int(11) NOT NULL auto_increment,
  `kll_timestamp` datetime NOT NULL default "0000-00-00 00:00:00",
  `kll_external_id` int(8) default NULL,
  `kll_hash` BINARY(16) NOT NULL,
  `kll_trust` TINYINT NOT NULL DEFAULT 0,
  PRIMARY KEY  (`kll_id`),
  UNIQUE KEY `external_id` (`kll_external_id`),
  UNIQUE KEY `time_hash` (`kll_timestamp`,`kll_hash`)
) Engine=InnoDB';
            $qry->execute($sql);
        }
        killCache();
        config::set("DBUpdate", "014");
        $qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '014' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '014'");
        config::del("014updatestatus");
        $smarty->assign('refresh', 1);
        $smarty->assign('content', "Update 014 completed.");
        $smarty->display('update.tpl');
        die;
    }
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:33,代码来源:update.php

示例4: update016

/**
 * @package EDK
 */
function update016()
{
    global $url, $smarty;
    //Checking if this Update already done
    if (CURRENT_DB_UPDATE < "016") {
        $qry = DBFactory::getDBQuery(true);
        $sql = "ALTER TABLE `kb3_mails` ADD `kll_modified_time` DATETIME NOT NULL ";
        $qry->execute("SHOW COLUMNS FROM kb3_mails LIKE 'kll_modified_time'");
        if (!$qry->recordCount()) {
            $qry->execute($sql);
        }
        $sql = "ALTER TABLE `kb3_mails` ADD INDEX ( `kll_modified_time` ) ";
        $qry->execute("SHOW INDEXES FROM kb3_mails");
        $indexexists = false;
        while ($testresult = $qry->getRow()) {
            if ($testresult['Column_name'] == 'kll_modified_time') {
                $indexexists = true;
            }
        }
        if (!$indexexists) {
            $qry->execute($sql);
        }
        config::set("DBUpdate", "016");
        $qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '016' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '016'");
        $smarty->assign('refresh', 1);
        $smarty->assign('content', "Update 016 completed.");
        $smarty->display('update.tpl');
        die;
    }
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:33,代码来源:update.php

示例5: updateChars

 private function updateChars()
 {
     if (empty($this->chars)) {
         return $this->chars;
     }
     foreach ($this->chars as $char) {
         // check if chars eveid exists in kb
         $sql = 'select plts.plt_id, plts.plt_externalid from kb3_pilots plts where plts.plt_name = "' . $char['Name'] . '"';
         $qry = DBFactory::getDBQuery();
         $qry->execute($sql);
         if ($qry->recordCount() != 0) {
             // pilot is in kb db, check he has his char id
             $row = $qry->getRow();
             $pilot_id = $row['plt_id'];
             $pilot_external_id = $row['plt_externalid'];
             if ($pilot_external_id == 0 && $pilot_id != 0) {
                 // update DB with ID
                 $qry->execute("UPDATE kb3_pilots SET plt_externalid = " . intval($char['charID']) . "\n                                     WHERE plt_id = " . $pilot_id);
             }
         } else {
             // pilot is not in DB
             // Set Corp
             $pilotscorp = Corporation::lookup($char['corpName']);
             // Check Corp was set, if not, add the Corp
             if (!$pilotscorp->getID()) {
                 $ialliance = Alliance::add('None');
                 $pilotscorp = Corporation::add($char['corpName'], $ialliance, gmdate("Y-m-d H:i:s"));
             }
             Pilot::add($char['Name'], $pilotscorp, gmdate("Y-m-d H:i:s"), intval($char['charID']));
         }
     }
     return;
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:33,代码来源:class.char.php

示例6: ItemList

 /**
  *
  * @param array $itemarray
  * @param float $price
  */
 function ItemList($itemarray = null, $price = 0)
 {
     if (isset($itemarray)) {
         $this->itemarray = $itemarray;
     }
     $this->price = $price;
     $this->qry = DBFactory::getDBQuery();
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:13,代码来源:class.itemlist.php

示例7: logKill

 /**
  * Log a new kill.
  *
  * @param integer $killid
  * @param string $note
  */
 public static function logKill($killid, $note = null)
 {
     if (is_null($note)) {
         $note = "IP:" . logger::getip();
     }
     $qry = DBFactory::getDBQuery(true);
     $qry->execute("INSERT INTO kb3_log (log_kll_id, log_site," . " log_ip_address, log_timestamp) values(" . $killid . ",'" . KB_SITE . "','" . $qry->escape($note) . "', UTC_TIMESTAMP())");
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:14,代码来源:class.logger.php

示例8: execQuery

 function execQuery()
 {
     $qry = DBFactory::getDBQuery();
     $qry->execute("select * from kb3_regions where reg_id = " . $this->id);
     $row = $qry->getRow();
     $this->name = $row['reg_name'];
     $this->coords = array($row['reg_x'], $row['reg_y'], $row['reg_z']);
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:8,代码来源:class.region.php

示例9: getShipClassIDByName

 public static function getShipClassIDByName($shipClassName)
 {
     $query = "SELECT scl_id FROM kb3_ship_classes WHERE scl_class = '{$shipClassName}'";
     $qry = DBFactory::getDBQuery();
     $qry->execute($query);
     $shipClassId = $qry->getRow();
     return $shipClassId["scl_id"];
 }
开发者ID:Salvoxia,项目名称:highlight_capitals,代码行数:8,代码来源:init.php

示例10: delKill

 public static function delKill($kill)
 {
     $qry = DBFactory::getDBQuery();
     $qry->execute("BEGIN");
     allianceSummary::delKill($kill);
     corpSummary::delKill($kill);
     pilotSummary::delKill($kill);
     $qry->execute("COMMIT");
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:9,代码来源:class.summarycache.php

示例11: update022

function update022()
{
    global $url, $smarty;
    //Checking if this Update already done
    if (CURRENT_DB_UPDATE < "022") {
        if (is_null(config::get('022updatestatus'))) {
            config::set('022updatestatus', 0);
        }
        $qry = DBFactory::getDBQuery(true);
        if (config::get('022updatestatus') < 1) {
            $qry->execute("DELETE FROM `kb3_ships` WHERE `shp_externalid` = 0 AND `shp_name` NOT LIKE '%Unknown%'");
            $qry->execute("DELETE FROM `kb3_ships` WHERE `shp_id` IN (206, 497, 348, 349,352, 354, 606)");
            config::set('022updatestatus', 1);
            $smarty->assign('refresh', 1);
            $smarty->assign('content', "22. Delete unused and duplicated ships from ships table.");
            $smarty->display('update.tpl');
            die;
        }
        if (config::get('022updatestatus') < 2) {
            // Add timestamp column to kb3_inv_detail
            $qry->execute("SHOW INDEX FROM `kb3_ships`");
            $indextexists = false;
            while ($testresult = $qry->getRow()) {
                if ($testresult['Column_name'] == 'shp_externalid') {
                    $indextexists = true;
                }
            }
            if (!$indextexists) {
                $qry->execute("ALTER TABLE `kb3_ships` ADD UNIQUE `shp_externalid` ( `shp_externalid` ) ");
                config::set('022updatestatus', 2);
                $smarty->assign('refresh', 1);
                $smarty->assign('content', "22. Ships table added unique index for external IDs.");
                $smarty->display('update.tpl');
                die;
            }
        }
        if (config::get('022updatestatus') < 3) {
            //not too happy about this one but it does force the ships to use *my* IDs, as it would be if i dumped it - FRK
            $qry->execute("INSERT IGNORE INTO `kb3_ships` (`shp_id` ,`shp_name` ,`shp_class` ,`shp_externalid` ,`shp_rce_id` ,`shp_baseprice` ,`shp_techlevel` ,`shp_isfaction`) VALUES (704 , 'Guristas Shuttle', '11', '21628', '1', '10000000', '1', '1');");
            $qry->execute("INSERT IGNORE INTO `kb3_ships` (`shp_id` ,`shp_name` ,`shp_class` ,`shp_externalid` ,`shp_rce_id` ,`shp_baseprice` ,`shp_techlevel` ,`shp_isfaction`) VALUES (705 , 'Civilian Gallente Shuttle', '11', '27303', '8', '0', '1', '0');");
            config::set('022updatestatus', 3);
            $smarty->assign('refresh', 1);
            $smarty->assign('content', "22. Insert missing shuttles.");
            $smarty->display('update.tpl');
            die;
        }
        killCache();
        config::set("DBUpdate", "022");
        $qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '022' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '022'");
        config::del("022updatestatus");
        $smarty->assign('refresh', 1);
        $smarty->assign('content', "Update 022 completed.");
        $smarty->display('update.tpl');
        die;
    }
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:56,代码来源:update.php

示例12: stats

 function stats()
 {
     global $smarty;
     $qry = DBFactory::getDBQuery();
     $qry->execute("SELECT COUNT(*) AS cnt FROM kb3_kills");
     $row = $qry->getRow();
     $kills = $row['cnt'];
     $smarty->assign('kills', $kills);
     return $smarty->fetch(get_tpl("about_stats"));
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:10,代码来源:about.php

示例13: hasCampaigns

 public static function hasCampaigns($active = false)
 {
     $qry = DBFactory::getDBQuery();
     $sql = "select ctr_id\n                 from kb3_contracts\n\t         where ctr_site = '" . KB_SITE . "'";
     if ($active) {
         $sql .= " and ( ctr_ended is null or now() <= ctr_ended ) limit 1";
     }
     $qry->execute($sql);
     return $qry->recordCount() > 0;
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:10,代码来源:class.killboard.php

示例14: update021

function update021()
{
    global $url, $smarty;
    //Checking if this Update already done
    if (CURRENT_DB_UPDATE < "021") {
        $qry = DBFactory::getDBQuery(true);
        if (is_null(config::get('021updatestatus'))) {
            config::set('021updatestatus', 0);
        }
        if (config::get('021updatestatus') < 1) {
            // Add timestamp column to kb3_inv_detail
            $qry->execute("SHOW COLUMNS FROM kb3_ships LIKE 'shp_isfaction'");
            if (!$qry->recordCount()) {
                $qry->execute("ALTER TABLE `kb3_ships` ADD `shp_isfaction` TINYINT(1) DEFAULT '0' AFTER `shp_techlevel`;");
                config::set('021updatestatus', 1);
                $smarty->assign('refresh', 1);
                $smarty->assign('content', "21. kb3_ships shp_isfaction column added");
                $smarty->display('update.tpl');
                die;
            }
        }
        if (config::get('021updatestatus') < 3) {
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 3628;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17715;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17718;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17720;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17722;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17736;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17738;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17740;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17918;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17920;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17922;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17924;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17926;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17928;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17930;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 17932;");
            $qry->execute("UPDATE kb3_ships SET shp_isfaction = '1' WHERE shp_externalid = 32207;");
            config::set('021updatestatus', 3);
            $smarty->assign('refresh', 1);
            $smarty->assign('content', "21. faction tags added");
            $smarty->display('update.tpl');
            die;
        }
        killCache();
        config::set("DBUpdate", "021");
        $qry->execute("INSERT INTO kb3_config (cfg_site, cfg_key, cfg_value) SELECT cfg_site, 'DBUpdate', '021' FROM kb3_config GROUP BY cfg_site ON DUPLICATE KEY UPDATE cfg_value = '021'");
        config::del("021updatestatus");
        $smarty->assign('refresh', 1);
        $smarty->assign('content', "Update 021 completed.");
        $smarty->display('update.tpl');
        die;
    }
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:55,代码来源:update.php

示例15: getMoonName

 public static function getMoonName($id)
 {
     if ($id != 0) {
         $qry = DBFactory::getDBQuery();
         $sql = 'select moo_name FROM kb3_moons WHERE moo_id = ' . $id;
         $qry->execute($sql);
         $row = $qry->getRow();
         return $row['moo_name'];
     } else {
         return false;
     }
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:12,代码来源:class.helpers.php


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