本文整理汇总了PHP中getRows函数的典型用法代码示例。如果您正苦于以下问题:PHP getRows函数的具体用法?PHP getRows怎么用?PHP getRows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: duplicate_po_ed
function duplicate_po_ed($personnel)
{
$sql = "select count(*) as dup from po_ed where personcd='{$personnel}'";
$rs = execSelect($sql);
$row = getRows($rs);
$dup = $row['dup'];
return $dup;
}
示例2: lisr_user_id
function lisr_user_id()
{
$sql = "select count(*) as c_user from user where user_id='{$userid}'";
$rs = execSelect($sql);
$row = getRows($rs);
$c_user = $row['c_user'];
return $c_user;
}
示例3: chk_trainingvenue
function chk_trainingvenue($venue_cd)
{
$sql = "Select count(*) as total From second_training WHERE second_training.training_venue='{$venue_cd}'";
$rs = execSelect($sql);
$row = getRows($rs);
$total = $row['total'];
unset($sql, $rs, $row);
return $total;
}
示例4: jmd_admin_js
function jmd_admin_js()
{
global $event;
if ($rs = getRows('select name, js from ' . safe_pfx('txp_js'))) {
foreach ($rs as $row) {
if ($row['name'] === 'default' || $row['name'] === $event) {
$out[] = base64_decode($row['js']);
}
}
echo tag(join("\n", $out), 'script', ' type="text/javascript"');
}
}
示例5: check_tables
function check_tables($tables, $type = 'FAST', $warnings = 0)
{
$msgs = array();
foreach ($tables as $table) {
$rs = getRows("CHECK TABLE {$table} {$type}");
if ($rs) {
foreach ($rs as $r) {
if ($r['Msg_type'] != 'status' and ($warnings or $r['Msg_type'] != 'warning')) {
$msgs[] = $table . cs . $r['Msg_type'] . cs . $r['Msg_text'];
}
}
}
}
return $msgs;
}
示例6: fatch_Random_personnel_for_replacement
function fatch_Random_personnel_for_replacement($forpc, $assembly, $posting_status, $gender)
{
$sqlc = "select count(*) as cnt\r\n\tFrom personnela Inner Join office On personnela.officecd = office.officecd \r\n \tInner Join policestation On office.policestn_cd = policestation.policestationcd\r\n \tInner Join subdivision On office.subdivisioncd = subdivision.subdivisioncd\r\n \tInner Join poststat On personnela.poststat = poststat.post_stat\r\n \tInner Join assembly As ass_pre On personnela.assembly_temp = ass_pre.assemblycd\r\n \tInner Join assembly ass_per On personnela.assembly_perm = ass_per.assemblycd \r\n \tInner Join assembly ass_ofc On personnela.assembly_off = ass_ofc.assemblycd\r\n \tInner Join district On district.districtcd = subdivision.districtcd \r\n\tLeft Join termination On personnela.personcd = termination.personal_id";
$sqlc .= " WHERE termination.personal_id is null and personnela.gender='{$gender}' and personnela.assembly_temp<>'{$assembly}' and personnela.assembly_perm<>'{$assembly}' and personnela.assembly_off<>'{$assembly}' and personnela.poststat='{$posting_status}' ";
$sqlc .= " and (personnela.booked='' or personnela.booked is null) and personnela.forpc='{$forpc}'";
$rsc = execSelect($sqlc);
$rowc = getRows($rsc);
$limit = $rowc['cnt'];
//echo $limit; exit;
$random_no = rand(0, $limit - 1);
$sql = "Select personnela.personcd,personnela.officecd,personnela.officer_name,personnela.off_desg,office.address1,\r\n \toffice.address2,office.postoffice,policestation.policestation,subdivision.subdivision,district.district,\r\n office.pin,DATE_FORMAT(personnela.dateofbirth,'%d-%m-%Y') as dateofbirth,personnela.gender,personnela.epic,\r\n \tpoststat.poststatus,personnela.present_addr1,personnela.present_addr2,ass_pre.assemblyname As pre_ass,\r\n \tass_per.assemblyname As per_ass,ass_ofc.assemblyname As post_ass\r\n\tFrom personnela Inner Join office On personnela.officecd = office.officecd\r\n \tInner Join policestation On office.policestn_cd = policestation.policestationcd \r\n \tInner Join subdivision On office.subdivisioncd = subdivision.subdivisioncd\r\n \tInner Join poststat On personnela.poststat = poststat.post_stat\r\n \tInner Join assembly As ass_pre On personnela.assembly_temp = ass_pre.assemblycd \r\n \tInner Join assembly ass_per On personnela.assembly_perm = ass_per.assemblycd\r\n \tInner Join assembly ass_ofc On personnela.assembly_off = ass_ofc.assemblycd\r\n \tInner Join district On district.districtcd = subdivision.districtcd\r\n\tLeft Join termination On personnela.personcd = termination.personal_id ";
$sql .= " WHERE termination.personal_id is null and personnela.gender='{$gender}' and personnela.assembly_temp<>'{$assembly}' and personnela.assembly_perm<>'{$assembly}' and personnela.assembly_off<>'{$assembly}' and personnela.poststat='{$posting_status}' ";
$sql .= " and (personnela.booked='' or personnela.booked is null) and personnela.forpc='{$forpc}'";
$sql .= " limit 1 offset {$random_no}";
$rs = execSelect($sql);
connection_close();
return $rs;
}
示例7: amplifyCell
function amplifyCell(&$record, $dummy = NULL)
{
switch ($record['realm']) {
case 'object':
$record['ports'] = getObjectPortsAndLinks($record['id']);
$record['ipv4'] = getObjectIPv4Allocations($record['id']);
$record['ipv6'] = getObjectIPv6Allocations($record['id']);
$record['nat4'] = getNATv4ForObject($record['id']);
$record['files'] = getFilesOfEntity($record['realm'], $record['id']);
break;
case 'file':
$record['links'] = getFileLinks($record['id']);
break;
case 'location':
$record['locations'] = getLocations($record['id']);
$record['rows'] = getRows($record['id']);
break;
case 'row':
$record['racks'] = getRacks($record['id']);
case 'rack':
$record['mountedObjects'] = array();
// start with default rackspace
for ($i = $record['height']; $i > 0; $i--) {
for ($locidx = 0; $locidx < 3; $locidx++) {
$record[$i][$locidx]['state'] = 'F';
}
}
// load difference
$query = "select unit_no, atom, state, object_id " . "from RackSpace where rack_id = ? and " . "unit_no between 1 and ? order by unit_no";
$result = usePreparedSelectBlade($query, array($record['id'], $record['height']));
global $loclist;
$mounted_objects = array();
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$record[$row['unit_no']][$loclist[$row['atom']]]['state'] = $row['state'];
$record[$row['unit_no']][$loclist[$row['atom']]]['object_id'] = $row['object_id'];
if ($row['state'] == 'T' and $row['object_id'] != NULL) {
$mounted_objects[$row['object_id']] = TRUE;
}
}
$record['mountedObjects'] = array_keys($mounted_objects);
unset($result);
break;
case 'vst':
$record['rules'] = array();
$record['switches'] = array();
$result = usePreparedSelectBlade('SELECT rule_no, port_pcre, port_role, wrt_vlans, description ' . 'FROM VLANSTRule WHERE vst_id = ? ORDER BY rule_no', array($record['id']));
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$record['rules'][$row['rule_no']] = $row;
}
unset($result);
$result = usePreparedSelectBlade('SELECT object_id, domain_id FROM VLANSwitch WHERE template_id = ?', array($record['id']));
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$record['switches'][$row['object_id']] = $row;
}
break;
default:
}
}
示例8: basename
?>
" class="open_close" id="close_in"><i class="icon_set_1_icon-77"></i></a>
<ul>
<li <?php
echo basename($_SERVER['PHP_SELF']) == 'index.php' ? ' class="active"' : '';
?>
class="submenu">
<a href="<?php
echo site_url('');
?>
" class="show-submenu">Home</a>
</li> <li class="submenu">
<a href="javascript:void(0);" class="show-submenu">Tours Packages <i class="icon-down-open-mini"></i></a>
<?php
$category_where = array('is_deleted' => 'N', 'is_active' => 'Y');
$category_rows_data = getRows(DB_TABLE_PREFIX . 'category', $category_where, "*", 'sort_order');
$category_data = $category_rows_data['data'];
if ($category_rows_data['total_recs'] > 0) {
?>
<ul>
<li<?php
echo basename($_SERVER['PHP_SELF']) == 'all_tours_list.php' ? ' class="active"' : '';
?>
><a href="<?php
echo site_url('');
?>
all_tours_list.php">All tours list</a></li>
<?php
foreach ($category_data as $side_bar_category) {
示例9: personnel_list
<td colspan="2"> </td>
</tr>
<tr>
<td align="left">Polling Party No:</td>
<td align="left"><input type="text" name="polling_party_no" id="polling_party_no" style="width:142px;" onchange="return personnel_list();" /></td><td colspan="2"> </td>
</tr>
<tr>
<td align="left">Post Status:</td>
<td align="left" colspan="3"><select id="posting_status" name="posting_status" onchange="return personnel_list();" style="width:150px;">
<option value="0">-Select Posting Status-</option>
<?php
$rsP = fatch_postingstatus();
$num_rows = rowCount($rsP);
if ($num_rows > 0) {
for ($i = 1; $i <= $num_rows; $i++) {
$rowP = getRows($rsP);
echo "<option value='{$rowP['0']}'>{$rowP['1']}</option>\n";
}
}
$rsP = null;
$num_rows = 0;
$rowP = null;
?>
</select></td>
</tr>
<tr>
<td align="left"><b>Personnel ID:</b></td>
<td align="left"><span id="personnel_list"><select id="p_id" name="p_id" style="width:150px;" onchange="fatch_personnel_dtl(this.value);"></select>
</span></td>
<td align="left"><b>Office ID:</b></td>
<td align="left" width="60px"><span id="ofc_id"></span></td>
示例10: PC_change
<table width="100%">
<tr><input type="hidden" id="hid_subdiv" value="<?php
print $subdiv_cd;
?>
" />
<td align="left">Parliamentary Constituency</td>
<td align="left"><select name="PC" id="PC" style="width:180px;" onchange="return PC_change(this.value);">
<option value="0">-Select PC-</option>
<?php
$districtcd = $dist_cd;
include_once 'function/form_12_fun.php';
$rsPC = fatch_PC_ag_dist($districtcd);
$num_rows = rowCount($rsPC);
if ($num_rows > 0) {
for ($i = 1; $i <= $num_rows; $i++) {
$rowPC = getRows($rsPC);
echo "<option value='{$rowPC['0']}'>{$rowPC['1']}</option>\n";
$rowPC = null;
}
}
$rsPC = null;
$num_rows = 0;
?>
</select>
</td>
<td rowspan="2" width="50px">OR</td>
</tr>
<tr>
<td align="left">Assembly Constituency</td>
<td align="left" id="assembly_result"><select name="assembly" id="assembly" style="width:180px;"></select></td>
</tr>
示例11: getRows
$rows_data_cat = getRows(DB_TABLE_PREFIX . 'category', $where_cat, '*');
$cat_data = $rows_data_cat['data'];
$category = $cat_data[0];
?>
<div class="short_info"><i class="icon_set_1_icon-4"></i><?php
echo $category['title'];
?>
</div></a>
</div>
</div>
<div class="clearfix visible-xs-block"></div>
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="tour_list_desc">
<?php
$where2 = array('product_id' => $id);
$rows_data2 = getRows(DB_TABLE_PREFIX . 'reviews', $where2, '*');
$product_data2 = $rows_data2['data'];
if ($rows_data2['total_recs'] > 0) {
$total = 0;
foreach ($product_data2 as $product) {
extract($product);
$total_re_overall += $review_overall / 10;
?>
<?php
}
$totalnum = count($product_data2);
$re_overall = $total_re_overall / $totalnum * 100;
?>
示例12: getRows
<?php
if (isset($_GET[newsid]) && !empty($_GET[newsid])) {
require_once "action/checkAamsLogin.php";
require_once "action/smarty_inc.php";
require_once "action/mysql.class.php";
$query = $db->query("select * from news where id = '{$_GET['newsid']}'");
$info = $db->fetch_array($query);
$smarty->assign("newsinfo", $info);
$rows = getRows(" news_type where pid=0 ", $db);
$smarty->assign("typeRows", $rows);
$smarty->display("updatenews.html");
} else {
echo "<script>window.history.back();</script>";
exit;
}
示例13: sitemapXML
public function sitemapXML()
{
static $mlp_installed;
if (!isset($mlp_installed)) {
$mlp_installed = is_callable('l10n_installed') ? call_user_func('l10n_installed', true) : false;
}
$out = '<?xml version="1.0" encoding="utf-8"?>';
$out .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
// Homepage
$out .= $this->urlXML(hu);
// Excluded sections
$excluded = $GLOBALS['prefs']['jmd_sitemap_exclude'];
$excluded = unserialize($excluded);
foreach ($excluded as $key => $value) {
$notIn[$key] = "'{$value}'";
}
$notIn = implode(',', $notIn);
$notIn .= ",'default'";
// List sections
$site_langs = array();
if ($mlp_installed) {
$site_langs = MLPLanguageHandler::get_site_langs();
}
$sections = safe_column("name", "txp_section", "name not in({$notIn})");
foreach ($sections as $section) {
if ($mlp_installed) {
foreach ($site_langs as $lang) {
$lang = substr($lang, 0, 2) . '/';
$loc = hu . $lang . urlencode($section) . '/';
$out .= $this->urlXML($loc);
}
} else {
$loc = pagelinkurl(array('s' => $section));
$out .= $this->urlXML($loc);
}
}
// Articles
$fields = 'ID as thisid, Section as section, Title as title,
url_title, unix_timestamp(Posted) as posted,
unix_timestamp(LastMod) as lastmod';
if ($mlp_installed) {
$fields .= ', l10n_lang';
}
$articles = getRows("select {$fields} from " . safe_pfx('textpattern') . " where Status = 4 and Posted<= now() and section not in({$notIn})");
if ($articles) {
include_once txpath . '/publish/taghandlers.php';
foreach ($articles as $article) {
$loc = permlinkurl($article);
if ($mlp_installed) {
$loc = str_replace(hu, hu . substr($article['l10n_lang'], 0, 2) . '/', $loc);
}
$lastmod = date('c', $article['lastmod']);
$out .= $this->urlXML($loc, $lastmod);
}
}
$out .= '</urlset>';
return $out;
}
示例14: isSquare
public function isSquare()
{
return getRows() == getCols();
}
示例15: getRows
<?php
function getRows($file)
{
$handle = fopen($file, 'rb');
if ($handle === false) {
throw new Exception();
}
while (feof($handle) === false) {
(yield fgetcsv($handle));
}
fclose($handle);
}
foreach (getRows('data.csv') as $row) {
print_r($row);
}