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


PHP DBQuery::getErrorMsg方法代码示例

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


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

示例1: DBQuery

 $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>";
 } else {
     $html .= "No matches found for '" . htmlentities($_POST['add_name']) . "'.";
 }
 while ($row = $qry->getRow()) {
     $html .= "<tr class='kb-table-row-even'>";
     $editURL = edkuri::build(array(array('ctr_id', $ctrID, false), array('op', 'edit', false), array('add_type', (int) $_POST['add_type'], false), array('add_id', $row['id'], false)));
     switch ($_POST['add_type']) {
         case 0:
             $html .= '<td><a href="' . edkURI::page('corp_detail', $row['id'], 'crp_id') . '">' . $row['name'] . "</a></td><td align='center'><button id='submit' name='submit' onclick=\"window.location.href='" . $editURL . "'\">Select</button></td>";
             break;
         case 1:
             $html .= '<td><a href="' . edkURI::page('alliance_detail', $row['id'], 'all_id') . '">' . $row['name'] . "</a></td><td align='center'><button id='submit' name='submit' onclick=\"window.location.href='" . $editURL . "'\">Select</button></td>";
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:admin_cc.php

示例2: showactivityoverview

 function showactivityoverview()
 {
     $week = $this->getWeek();
     $month = $this->getMonth();
     $year = $this->getYear();
     if (config::get('show_activity_overview')) {
         if (!config::get('show_monthly')) {
             $weekly = 1;
         } else {
             $weekly = 0;
         }
         $row_counter = 0;
         $html .= '<table class=kb-table width="100%" border=0 cellspacing="1">';
         if ($weekly == 1) {
             $html .= '<tr ><td colspan="3" class=kb-table-header>Activity Map for Week ' . $week . '</td></tr>';
         } else {
             $html .= '<tr ><td colspan="3" class=kb-table-header>Activity Map for ' . date('F', mktime(0, 1, 0, $month, 1, $year)) . '</td></tr>';
         }
         $html .= '<tr>';
         $sql2 = "select reg.reg_id, count(distinct kll.kll_id) as kills\n\t\t\t\t\t\tfrom kb3_systems sys, kb3_kills kll, kb3_inv_detail inv, kb3_constellations con, kb3_regions reg\n\t\t\t\t\t\twhere kll.kll_system_id = sys.sys_id\n\t\t\t\t\t\tand inv.ind_kll_id = kll.kll_id";
         if (count(config::get('cfg_allianceid'))) {
             $orargs[] = 'inv.ind_all_id IN (' . implode(",", config::get('cfg_allianceid')) . ") ";
         }
         if (count(config::get('cfg_corpid'))) {
             $orargs[] = 'inv.ind_crp_id IN (' . implode(",", config::get('cfg_corpid')) . ") ";
         }
         if (count(config::get('cfg_pilotid'))) {
             $orargs[] = 'inv.ind_plt_id IN (' . implode(",", config::get('cfg_pilotid')) . ") ";
         }
         $sql2 .= " AND (" . implode(" OR ", $orargs) . ")";
         if ($weekly == 1) {
             $sql2 .= "\t\tand date_format( kll.kll_timestamp, \"%u\" ) = " . $week . " ";
         } else {
             $sql2 .= "\t\tand date_format( kll.kll_timestamp, \"%m\" ) = " . $month . " ";
         }
         $sql2 .= "\t\tand date_format( kll.kll_timestamp, \"%Y\" ) = " . $year . "\n\t\t\t\t\t\tand 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\tgroup by reg.reg_id\n\t\t\t\t\t\torder by kills desc\n\t\t\t\t\t\tLIMIT 0,3;";
         $qry2 = new DBQuery();
         $qry2->execute($sql2) or die($qry2->getErrorMsg());
         while ($row2 = $qry2->getRow()) {
             $row_counter++;
             $link = edkuri::build(array(array('a', 'detail_view', true), array('region_id', $row2['reg_id'], true)));
             if ($weekly == 1) {
                 $html .= '<td align="center"><a href="' . $link . '"><img src="?a=map&mode=activity&size=250&region_id=' . $row2['reg_id'] . '&week=' . $week . '&year=' . $year . '" border=0 /></a></td>';
             } else {
                 $html .= '<td align="center"><a href="' . $link . '"><img src="?a=map&mode=activity&size=250&region_id=' . $row2['reg_id'] . '&month=' . $month . '&year=' . kbdate("Y") . '" border=0 /></a></td>';
             }
         }
         while ($row_counter < 3) {
             $row_counter++;
             $html .= '<td align="center"><img width="250" height="250" src="?a=map&mode=na&size=250"></td>';
         }
         $html .= '</tr></table><br />';
     }
     return $html;
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:55,代码来源:home.php

示例3: TrovaInvolvedParty

function TrovaInvolvedParty($kill, &$killers)
{
    $qry = new DBQuery();
    /*        $qry->execute("SELECT kb3_pilots.plt_name as pilot, kb3_corps.crp_name as corp, kb3_pilots.plt_id as id, kb3_pilots.plt_externalid as xid 
            FROM kb3_inv_detail, kb3_pilots, kb3_corps
            WHERE (kb3_inv_detail.ind_plt_id = kb3_pilots.plt_id)and (kb3_inv_detail.ind_crp_id = kb3_corps.crp_id)and(kb3_inv_detail.ind_kll_id =" . $kill->getID() .")") 
            or die($qry->getErrorMsg()); 
    */
    $qry->execute("SELECT kb3_pilots.plt_name AS pilot, kb3_corps.crp_name AS corp, kb3_pilots.plt_id AS id, kb3_pilots.plt_externalid AS xid, kb3_ships.shp_class AS SClass\n        FROM kb3_inv_detail, kb3_pilots, kb3_corps, kb3_ships\n        WHERE (\n            kb3_inv_detail.ind_plt_id = kb3_pilots.plt_id\n            )\n        AND (\n            kb3_inv_detail.ind_crp_id = kb3_corps.crp_id\n            )\n        AND (\n            kb3_inv_detail.ind_shp_id = kb3_ships.shp_id\n            )\n        AND (\n            kb3_inv_detail.ind_kll_id = " . $kill->getID() . ")") or die($qry->getErrorMsg());
    $bs = 0;
    while ($row = $qry->getRow()) {
        $pilot = TestPilotName($row['pilot']);
        $killers[$pilot]['punti'] += $kill->getKillPoints();
        if ($pilot == TestPilotName($kill->getFBPilotName())) {
            $killers[$pilot]['punti'] += 1;
        }
        $killers[$pilot]['portrait'] = "?a=thumb&amp;id=" . $row['xid'] . "&amp;size=32";
        $killers[$pilot]['corp'] = $row['corp'];
        $killers[$pilot]['id'] = $row['id'];
        if ($row['SClass'] == 1) {
            //battleship
            $bs++;
        }
    }
    return $bs;
}
开发者ID:Salvoxia,项目名称:fleet_battles_mod,代码行数:26,代码来源:class.killlisttable.php

示例4: generate

    function generate()
    {
        $regioncache = KB_CACHEDIR . '/img/map/' . KB_SITE . '_' . $this->regionid_ . '_' . $this->imgwidth_ . '.png';
        $is_cached = 0;
        //INIT
        $title_caption = $this->regname_;
        if (file_exists($regioncache)) {
            $cfgttl = '6';
            $ttyl_sec = $cfgttl * 3600;
            $ttl = filemtime($regioncache) + $ttyl_sec;
            if ($ttl <= time()) {
                $is_cached = 0;
                unlink($regioncache);
                unlink($regioncache . ".txt");
            } else {
                $img = imagecreatefrompng($regioncache);
                $is_cached = 1;
            }
        }
        if ($is_cached == 0) {
            $sql = 'SELECT sys.sys_x, sys.sys_y, sys.sys_z, sys.sys_sec, sys.sys_id, sys.sys_name, sys.sys_id, sjp.sjp_to, con.con_id, con.con_name, reg.reg_id, reg.reg_name, reg.reg_x, reg.reg_z
				FROM kb3_systems sys
				LEFT JOIN kb3_system_jumps sjp ON sys.sys_id = sjp.sjp_from
				JOIN kb3_constellations con ON con.con_id = sys.sys_con_id
				JOIN kb3_regions reg ON reg.reg_id = con.con_reg_id';
            if ($this->mode_ == "sys") {
                $sql .= " and reg.reg_id = '" . $this->regionid_ . "'";
            } else {
                $sql .= " and reg.reg_id = " . $this->regionid2_;
            }
            $qry = new DBQuery();
            $qry->execute($sql) or die($qry->getErrorMsg());
            if (!$img) {
                $img = imagecreatetruecolor($this->imgwidth_, $this->imgheight_);
            }
            $white = imagecolorallocate($img, 255, 255, 255);
            $red = imagecolorallocate($img, 255, 0, 0);
            if (config::get('map_act_cl_bg')) {
                $bcolor = explode(",", config::get('map_act_cl_bg'));
                mapview::setbgcolor($bcolor[0], $bcolor[1], $bcolor[2]);
            }
            $bgcolor = imagecolorallocate($img, $this->bgcolor_[0], $this->bgcolor_[1], $this->bgcolor_[2]);
            imagefilledrectangle($img, 0, 0, $this->imgwidth_, $this->imgheight_, $bgcolor);
            $color = $white;
            $fov = 0;
            //INIT
            $i = 0;
            $minx = 0;
            $minz = 0;
            $maxx = 0;
            $maxz = 0;
            $mini = 0;
            $maxi = 0;
            $pi = 0;
            $sc = 0;
            $systems = array();
            while ($row = $qry->getRow()) {
                $i = $row['sys_id'];
                $systems[] = $i;
                if ($i < $mini || $mini == 0) {
                    $mini = $i;
                }
                if ($i > $maxi || $maxi == 0) {
                    $maxi = $i;
                }
                $x = $row['sys_x'] * $this->ly_;
                $z = $row['sys_z'] * $this->ly_;
                if ($x < $minx || $minx == 0) {
                    $minx = $x;
                }
                if ($x > $maxx || $maxx == 0) {
                    $maxx = $x;
                }
                if ($z < $minz || $minz == 0) {
                    $minz = $z;
                }
                if ($z > $maxz || $maxz == 0) {
                    $maxz = $z;
                }
                $sys[$i][0] = $x;
                $sys[$i][1] = $z;
                if ($i == $pi || $pi == 0) {
                    $sys[$i][2][$sc] = $row['sjp_to'];
                    $sys[$i][3] = $sc++;
                } else {
                    $sc = 0;
                }
                $sys[$i][4] = $row['sys_id'];
                $sys[$i][5] = $row['sys_name'];
                $sys[$i][6] = $row['sys_sec'];
                $sys[$i][7] = $row['con_id'];
                $sys[$i][8] = $row['con_name'];
                $sys[$i][9] = $row['reg_id'];
                $sys[$i][10] = $row['reg_name'];
                $pi = $i;
            }
            $dx = abs($maxx - $minx);
            $dz = abs($maxz - $minz);
            $xscale = 1 / ($dx / ($this->imgwidth_ - $this->offset_ * 2));
            $yscale = 1 / ($dz / ($this->imgheight_ - $this->offset_ * 2));
//.........这里部分代码省略.........
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:101,代码来源:map.php

示例5: count

for ($i = 1; $i <= 12; $i++) {
    if ($region_set == 0) {
        $sql2 = "select reg.reg_id, count(distinct kll.kll_id) as kills \n\t\t\t\tfrom kb3_systems sys, kb3_kills kll, kb3_inv_detail inv, kb3_constellations con, kb3_regions reg\n\t\t\t\twhere kll.kll_system_id = sys.sys_id \n\t\t\t\tand inv.ind_kll_id = kll.kll_id";
        if (count(config::get('cfg_allianceid'))) {
            $orargs[] = 'inv.ind_all_id IN (' . implode(",", config::get('cfg_allianceid')) . ") ";
        }
        if (count(config::get('cfg_corpid'))) {
            $orargs[] = 'inv.ind_crp_id IN (' . implode(",", config::get('cfg_corpid')) . ") ";
        }
        if (count(config::get('cfg_pilotid'))) {
            $orargs[] = 'inv.ind_plt_id IN (' . implode(",", config::get('cfg_pilotid')) . ") ";
        }
        $sql2 .= " AND (" . implode(" OR ", $orargs) . ")";
        $sql2 .= "    and date_format( kll.kll_timestamp, \"%m\" ) = " . $i . "\n\t\t\t\tand date_format( kll.kll_timestamp, \"%Y\" ) = " . $year . "\n\t\t\t\tand con.con_id = sys.sys_con_id\n                and reg.reg_id = con.con_reg_id\n\t\t\t\tgroup by reg.reg_id\n\t\t\t\t\n\t\t\t\torder by kills desc\n\t\t\t\tLIMIT 0,1;";
        $qry2 = new DBQuery();
        $qry2->execute($sql2) or die($qry2->getErrorMsg());
        while ($row2 = $qry2->getRow()) {
            $region = $row2['reg_id'];
        }
    } else {
        $region = $region_set;
        $region_nav = '&region_id=' . $region_set;
    }
    if ($i % 2) {
        $html .= '<tr >';
    }
    if ($region != 0) {
        $html .= ' 	<td align="center"><img src="?a=map&mode=activity&size=350&region_id=' . $region . '&month=' . $i . '&year=' . $year . '" /></td>';
    } else {
        $html .= ' 	<td align="center"><img src="?a=map&mode=na&size=250" width="350" height="350"></td>';
    }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:map_year.php


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