本文整理汇总了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;
}
示例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;
示例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;
}