當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBQuery::recordCount方法代碼示例

本文整理匯總了PHP中DBQuery::recordCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBQuery::recordCount方法的具體用法?PHP DBQuery::recordCount怎麽用?PHP DBQuery::recordCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBQuery的用法示例。


在下文中一共展示了DBQuery::recordCount方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delScout

 function delScout($s_id, $pilotid)
 {
     $qry = new DBQuery(true);
     $qry->execute("delete from kb3_scout where inp_kll_id = " . $this->killID_ . " and scout_id = " . $s_id . " limit 1");
     //get pilot order to be deleted
     $pqry = new DBPreparedQuery();
     $pqry->prepare("select ind_order from kb3_inv_detail where ind_kll_id = ? and ind_plt_id = ?");
     $pqry->bind_param('ii', $this->killID_, $pilotid);
     $pqry->bind_result($scoutOrder);
     if (!$pqry->execute() || !$pqry->recordCount()) {
         return false;
     } else {
         $pqry->fetch();
     }
     //get highest pilot order
     $pqry = new DBPreparedQuery();
     $pqry->prepare("select max(ind_order) from kb3_inv_detail where ind_kll_id = ?");
     $pqry->bind_param('i', $this->killID_);
     $pqry->bind_result($maxScoutOrder);
     if (!$pqry->execute() || !$pqry->recordCount()) {
         return false;
     } else {
         $pqry->fetch();
     }
     $qry->execute("delete from kb3_inv_detail where ind_kll_id = " . $this->killID_ . " and ind_plt_id = " . $pilotid . " and ind_shp_id = '9999' limit 1");
     //reorder remaining scouts
     for ($i = $scoutOrder + 1; $i <= $maxScoutOrder; $i++) {
         $qry->execute("update kb3_inv_detail set ind_order = '" . ($i - 1) . "' where ind_kll_id = '" . $this->killID_ . "' and ind_shp_id = '9999' and ind_order = '" . $i . "' limit 1");
     }
     //remove from pilot's stats
     $qry->execute("SELECT 1 FROM kb3_sum_pilot WHERE psm_plt_id = '" . $pilotid . "'");
     if ($qry->recordCount() > 0) {
         $this->kill = new Kill($this->killID_);
         $qry->execute("UPDATE kb3_sum_pilot SET psm_kill_count = psm_kill_count - 1, psm_kill_isk = psm_kill_isk - '" . $this->kill->getISKLoss() . "' WHERE psm_plt_id = '" . $pilotid . "' AND psm_shp_id = '" . $this->kill->getVictimShip()->getClass()->getID() . "'");
         $qry->execute("UPDATE kb3_pilots SET plt_kpoints = plt_kpoints - '" . $this->kill->getKillPoints() . "' WHERE plt_id = '" . $pilotid . "'");
     }
     //make sure involved count is shown correctly (it's generated before this class is loaded)
     header("Location: ?a=kill_detail&kll_id=" . $this->killID_);
     exit;
 }
開發者ID:jjlupa,項目名稱:edk-mods,代碼行數:40,代碼來源:class.scout.php

示例2: switch

 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>";
             break;
開發者ID:biow0lf,項目名稱:evedev-kb,代碼行數:31,代碼來源:admin_cc.php

示例3: validate

 function validate()
 {
     $qry = new DBQuery();
     $qry->execute("select * from kb3_contracts\n                       where ctr_id = " . $this->ctr_id_ . "\n\t\t         and ctr_site = '" . KB_SITE . "'");
     return $qry->recordCount() > 0;
 }
開發者ID:Salvoxia,項目名稱:fleet_battles_mod,代碼行數:6,代碼來源:class.battles.php


注:本文中的DBQuery::recordCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。