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


PHP DBQuery::escape方法代码示例

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


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

示例1: ContractTarget

             $sys_id = $id;
             break;
     }
     $contracttarget = new ContractTarget($contract, $crp_id, $all_id, $reg_id, $sys_id);
     $contracttarget->add();
     header("Location: " . htmlspecialchars_decode($editURL));
 }
 if (isset($_POST['add_name'])) {
     $page->setTitle("Add target");
     if (strlen($_POST['add_name']) < 3) {
         $html .= "Please type atleast 3 letters.";
     } else {
         $qry = new DBQuery();
         switch ($_POST['add_type']) {
             case 0:
                 $sql = "select crp.crp_id as id, crp.crp_name as name\n                      from kb3_corps crp\n                     where lower( crp.crp_name ) like '%" . $qry->escape(strtolower($_POST['add_name']), true) . "%'";
                 break;
             case 1:
                 $sql = "select ali.all_id as id, ali.all_name as name\n                      from kb3_alliances ali\n                     where lower( ali.all_name ) like '%" . $qry->escape(strtolower($_POST['add_name']), true) . "%'";
                 break;
             case 2:
                 $sql = "select reg_id as id, reg_name as name\n                      from kb3_regions\n                     where lower( reg_name ) like '%" . $qry->escape(strtolower($_POST['add_name']), true) . "%'";
                 break;
             case 3:
                 $sql = "select sys_id as id, sys_name as name\n                      from kb3_systems\n                     where lower( sys_name ) like '%" . $qry->escape(strtolower($_POST['add_name']), true) . "%'";
                 break;
         }
         $qry->execute($sql) or die($qry->getErrorMsg());
         if ($qry->recordCount()) {
             $html .= "<table class='kb-table' width='450'>";
             $html .= "<tr class='kb-table-header'><td width='340'>Name</td><td width='80' align='center'>Action</td></tr>";
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:admin_cc.php

示例2: DBQuery

    $html .= '>Constellation</option>
					<option value="sys"';
    if ($_POST['selector'] == 'sys') {
        $html .= " selected";
    }
    $html .= '>System</option>
				</select><br />
				<br />
				<input name="" type="submit" value="Search"/>
			</form>';
    if (isset($_POST['search_string']) && $_POST['search_string'] != "") {
        $html .= '<br /><br />';
        $qry = new DBQuery();
        switch ($_POST['selector']) {
            case "reg":
                $sql = "\tSELECT reg_id, reg_name\n\t\t\t\t\t\tFROM `kb3_regions`\n\t\t\t\t\t\tWHERE `reg_name` LIKE '%" . $qry->escape($_POST['search_string'], true) . "%'";
                break;
            case "con":
                $sql = "\tSELECT con.con_name, reg.reg_id, reg.reg_name\n\t\t\t\t\t\tFROM kb3_constellations con, kb3_regions reg\n\t\t\t\t\t\tWHERE reg.reg_id = con.con_reg_id\n\t\t\t\t\t\tAND con.con_name LIKE '%" . $qry->escape($_POST['search_string'], true) . "%'";
                break;
            case "sys":
                $sql = "\tSELECT sys.sys_name, reg.reg_id, reg.reg_name\n\t\t\t\t\t\tFROM kb3_systems sys, kb3_constellations con, kb3_regions reg\n\t\t\t\t\t\tWHERE con.con_id = sys.sys_con_id\n\t\t\t\t\t\tAND reg.reg_id = con.con_reg_id\n\t\t\t\t\t\tAND sys.sys_name LIKE '%" . $qry->escape($_POST['search_string'], true) . "%'";
                break;
            default:
                exit;
        }
        $qry->execute($sql) or die($qry->getErrorMsg());
        if ($qry->recordCount()) {
            $html .= '<table width="250" border="0" cellspacing="1" cellpadding="1">';
            while ($row = $qry->getRow()) {
                $html .= '<tr>';
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:detail_view.php

示例3: isset

         continue;
     }
     $active = isset($val["active"]) ? 1 : 0;
     $lastkill = intval($val["lastkill"]);
     // check feed doesn't already exist
     foreach ($feeds as $fid => $fval) {
         if ($fval['uri'] == $uri) {
             $html .= "<br />Not Adding Duplicate Feed with URL: " . $uri;
             continue 2;
         }
     }
     $feed_flags = 0;
     if ($active) {
         $feed_flags |= FEED_ACTIVE;
     }
     $sql = "INSERT INTO kb3_feeds( feed_url, feed_lastkill, feed_kbsite, feed_flags) VALUES ( '" . $qry->escape($uri) . "', {$lastkill}, '" . KB_SITE . "', '{$feed_flags}' )";
     $qry->execute($sql);
     $qry->execute("SELECT * FROM kb3_feeds WHERE feed_kbsite = '" . KB_SITE . "' AND feed_url='" . $qry->escape($uri) . "'");
     while ($row = $qry->getRow()) {
         $active = (bool) ($row["feed_flags"] & FEED_ACTIVE);
         $feeds[$row["feed_id"]] = array('id' => $row["feed_id"], 'updated' => $row["feed_updated"], 'active' => $active, 'uri' => $row["feed_url"], 'lastkill' => $row["feed_lastkill"]);
     }
 } else {
     // update
     $id = intval($key);
     $uri = $val["url"];
     $active = isset($val["active"]) ? 1 : 0;
     $lastkill = intval($val["lastkill"]);
     if ($feeds[$id]['active'] != $active) {
         // flags have changed
         $feed_flags = 0;
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:admin_idfeedsyndication.php

示例4: DBQuery

                     break;
                 case 222:
                     if ($act->isOldKey($row['key_id'], $row['key_key'])) {
                         $flags |= KB_APIKEY_LEGACY;
                         break;
                     }
                     $flags |= KB_APIKEY_EXPIRED;
                     break;
                 default:
             }
         } else {
             // no error so user didn't have '256' access
         }
     }
     $qry2 = new DBQuery();
     $sql = "UPDATE kb3_api_keys SET key_flags = {$flags} WHERE key_name='" . $qry->escape($row['key_name']) . "' AND key_id='" . $qry->escape($row['key_id']) . "' AND key_key='" . $qry->escape($row['key_key']) . "' AND key_kbsite = '" . KB_SITE . "'";
     $qry2->execute($sql);
 }
 if ($flags & KB_APIKEY_LEGACY) {
     $html .= "<td></td><td>-</td><td>-</td>";
 } else {
     $html .= "<td>";
     $chars = array();
     if (!($flags & KB_APIKEY_BADAUTH || $flags & KB_APIKEY_EXPIRED)) {
         $act = new API_Account();
         $characters = $act->fetch($row['key_id'], $row['key_key']);
         if (is_array($characters)) {
             foreach ($act->fetch($row['key_id'], $row['key_key']) as $character) {
                 $chars[] = $character["characterName"] . ", " . $character["corporationName"];
             }
         } else {
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:admin_api.php

示例5: getShipStats

 function getShipStats($param_ship)
 {
     //global $shipStats;
     $qry = new DBQuery();
     $qry->execute("select kb3_invtypes.typeID, kb3_invtypes.description from kb3_invtypes WHERE kb3_invtypes.typeName = '" . $qry->escape($param_ship) . "'");
     $typeID = $qry->getRow();
     self::$shipStats->setShipIcon($typeID['typeID']);
     self::$shipStats->setShipDesc($typeID['description']);
     //$itemquery = mysql_query("select kb3_invtypes.typeID from kb3_invtypes WHERE kb3_invtypes.typeName = '".$param_ship."'") or die(mysql_error());
     //$typeID = mysql_fetch_array($itemquery);
     $qry2 = new DBQuery();
     $qry2->execute("select kb3_dgmtypeattributes.value, kb3_dgmattributetypes.attributeName, kb3_dgmattributetypes.displayName, kb3_dgmattributetypes.stackable, kb3_eveunits.displayName as unit\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nleft join kb3_eveunits on kb3_dgmattributetypes.unitID = kb3_eveunits.unitID\nwhere typeID = " . $typeID['typeID']);
     //$row = $qry2->getRow();
     while ($row = $qry2->getRow()) {
         if (strtolower($row['attributeName']) == "shieldcapacity") {
             self::$shipStats->setShieldAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "armorhp") {
             self::$shipStats->setArmorAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "hp") {
             self::$shipStats->setHullAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "scanradarstrength" && $row['value'] > 0) {
             self::$shipStats->setSensorType(fittingTools::getSensorTypeImg('radar'));
             self::$shipStats->setSensorAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "scanladarstrength" && $row['value'] > 0) {
             self::$shipStats->setSensorType(fittingTools::getSensorTypeImg('ladar'));
             self::$shipStats->setSensorAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "scanmagnetometricstrength" && $row['value'] > 0) {
             self::$shipStats->setSensorType(fittingTools::getSensorTypeImg('magnetometric'));
             self::$shipStats->setSensorAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "scangravimetricstrength" && $row['value'] > 0) {
             self::$shipStats->setSensorType(fittingTools::getSensorTypeImg('gravimetric'));
             self::$shipStats->setSensorAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "shieldemdamageresonance") {
             self::$shipStats->setShieldEM((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "shieldthermaldamageresonance") {
             self::$shipStats->setShieldTh((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "shieldkineticdamageresonance") {
             self::$shipStats->setShieldKi((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "shieldexplosivedamageresonance") {
             self::$shipStats->setShieldEx((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "shieldrechargerate") {
             self::$shipStats->setShieldRecharge($row['value'] / 1000);
         }
         if (strtolower($row['attributeName']) == "armoremdamageresonance") {
             self::$shipStats->setArmorEM((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "armorthermaldamageresonance") {
             self::$shipStats->setArmorTh((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "armorkineticdamageresonance") {
             self::$shipStats->setArmorKi((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "armorexplosivedamageresonance") {
             self::$shipStats->setArmorEx((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "emdamageresonance") {
             self::$shipStats->setHullEM((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "thermaldamageresonance") {
             self::$shipStats->setHullTh((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "kineticdamageresonance") {
             self::$shipStats->setHullKi((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "explosivedamageresonance") {
             self::$shipStats->setHullEx((1 - $row['value']) * 100);
         }
         if (strtolower($row['attributeName']) == "maxvelocity") {
             self::$shipStats->setShipSpeed($row['value']);
         }
         if (strtolower($row['attributeName']) == "signatureradius") {
             self::$shipStats->setSigRadius($row['value']);
         }
         if (strtolower($row['attributeName']) == "scanresolution") {
             self::$shipStats->setScan($row['value']);
         }
         if (strtolower($row['attributeName']) == "maxtargetrange") {
             self::$shipStats->setDistance($row['value']);
         }
         if (strtolower($row['attributeName']) == "maxlockedtargets") {
             self::$shipStats->setTarget($row['value']);
         }
         if (strtolower($row['attributeName']) == "capacitorcapacity") {
             self::$shipStats->setCapAmount($row['value']);
         }
         if (strtolower($row['attributeName']) == "rechargerate") {
             self::$shipStats->setCapRecharge($row['value']);
         }
         if (strtolower($row['attributeName']) == "rigsize") {
//.........这里部分代码省略.........
开发者ID:snitchashor,项目名称:ship_display_tool,代码行数:101,代码来源:init.php


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