本文整理汇总了PHP中getRow函数的典型用法代码示例。如果您正苦于以下问题:PHP getRow函数的具体用法?PHP getRow怎么用?PHP getRow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getScalar
function getScalar($query)
{
$result = getRow($query);
if (!$result) {
return false;
}
return array_pop($result);
}
示例2: index
public function index()
{
try {
$order = 1;
if (isset($_REQUEST["order"])) {
$order = intval($_REQUEST["order"]);
}
$roomDAO = CreateObject("Model_DAO_Room");
$tempOrder = $this->getTempOrder($order);
//dieu kien where
$where = "";
$where = $roomDAO->getWhere();
//echo $where;
if (strlen($where) != 0) {
$where = " where " . $where;
}
$this->getObjectSearch();
// end dieu kien where
$sql = "select * from " . table_prefix("room") . " " . $where . " " . $tempOrder;
//echo $sql;
$page = 1;
if (isset($_REQUEST["p"])) {
$page = intval($_REQUEST["p"]);
}
$row_total = getRow($sql);
$page_size = 6;
$pagegroup_size = 5;
if (isset($_REQUEST["order"])) {
$url = "index.php?rt=inex/index&order={$order}";
} else {
$url = "index.php?rt=inex/index";
}
$rooms = $roomDAO->lists($order, $page * $page_size - $page_size, $page_size);
$this->registry->template->page = $page;
$this->registry->template->row_total = $row_total;
$this->registry->template->page_size = $page_size;
$this->registry->template->pagegroup_size = $pagegroup_size;
$this->registry->template->url = $url;
$this->registry->template->rooms = $rooms;
$this->registry->template->roomDAO = $roomDAO;
if (isset($_SESSION["listSoSanh"])) {
$arrs = $_SESSION["listSoSanh"];
$roomSoSanhs = array();
foreach ($arrs as $item) {
$obj = $roomDAO->get($item);
$roomSoSanhs[] = $obj;
}
$this->registry->template->roomSoSanhs = $roomSoSanhs;
$this->registry->template->order = $order;
}
$searchObj = $_SESSION["searchObj"];
$this->registry->template->searchObj = $searchObj;
$this->registry->template->show('index_index');
} catch (MyException $ex) {
$ex->__toString();
}
}
示例3: getCuentasEmailsTo
function getCuentasEmailsTo()
{
$sql = "SELECT * FROM cuentas_emails_to";
$resultSet = getRS($sql);
$result = array();
while ($row = getRow($resultSet)) {
$result[$row["email"]] = $row["email"];
}
return $result;
}
示例4: contactInfo
function contactInfo($db, $call)
{
$contacts = '';
$q3 = "SELECT contact, validity " . "FROM ares_contact_info " . "WHERE `type` = 4 AND `call`='" . $call . "'";
//echo "<p>[" . $q3 . "]</p>\n";
$r3 = getResult($q3, $db);
if ($row3 = getRow($r3, $db)) {
$contacts = $row3[0];
}
echo $contacts . ", ";
}
示例5: completeInfoForApart
private function completeInfoForApart($apartId)
{
$SQL = "SELECT * FROM apartments a " . "WHERE id = " . $apartId;
try {
$row = getRow($SQL);
} catch (Exception $e) {
throw new Exception("Unable to get apartment info from database");
}
if (!$row) {
throw new Exception("An apartment doesn't exist in the database");
}
return $row;
}
示例6: valorizarPorCliente
function valorizarPorCliente($year = null, $paraGraf = false)
{
$data = "";
$sql = "SELECT *\n\t\t\t\tFROM\n\t\t\t\t(\n\t\t\t\t SELECT t2.id_cliente, t2.razon_social_cliente, SUM(t1.total_venta) total_por_cliente\n\t\t\t\t FROM ventas t1\n\t\t\t\t INNER JOIN clientes t2 ON t2.id_cliente=t1.id_cliente\n\t\t\t\t WHERE t1.id_registro_estado=1\n\t\t\t\t AND EXTRACT(YEAR FROM t1.fecha_venta) = {$year}\n\t\t\t\t GROUP BY t2.id_cliente\n\t\t\t\t) rs1\n\t\t\t\tORDER BY total_por_cliente DESC";
$rs = getRS($sql);
$sql = "SELECT SUM(t1.total_venta) total_por_anio\n\t\t\t\t FROM ventas t1\n\t\t\t\t WHERE t1.id_registro_estado=1\n\t\t\t\t AND EXTRACT(YEAR FROM t1.fecha_venta) = {$year}";
$rsTotalPorAnio = getRS($sql);
$rowTotalPorAnio = getRow($rsTotalPorAnio);
$totalPorAnio = $rowTotalPorAnio["total_por_anio"];
$porc_cte = 0;
$total_acum = 0;
$porc_fact = 0;
$porc_acum = 0;
$nroDeClientes = getNrosRows($rs);
if ($nroDeClientes) {
$nro = 1;
while ($row = getRow($rs)) {
$porc_cte = round($nro * 100 / $nroDeClientes, 2);
$porc_fact = round($row["total_por_cliente"] * 100 / $totalPorAnio, 4);
$porc_acum += $row["total_por_cliente"] * 100 / $totalPorAnio;
$total_acum += $row["total_por_cliente"];
$porc_item = round($porc_acum, 4);
if ($porc_item >= 0 && $porc_item <= 80) {
$clase = "A";
} else {
if ($porc_item > 80 && $porc_item <= 90) {
$clase = "B";
} else {
$clase = "C";
}
}
if (!$paraGraf) {
$data .= "<row id='" . $row["id_cliente"] . "'>" . "<cell><![CDATA[" . $nro . "]]></cell>" . "<cell><![CDATA[" . $row["razon_social_cliente"] . "]]></cell>" . "<cell><![CDATA[" . $porc_cte . "]]></cell>" . "<cell><![CDATA[" . round($row["total_por_cliente"], 2) . "]]></cell>" . "<cell><![CDATA[" . $porc_fact . "]]></cell>" . "<cell><![CDATA[" . round($total_acum, 2) . "]]></cell>" . "<cell><![CDATA[" . $porc_item . "]]></cell>" . "<cell><![CDATA[" . $clase . "]]></cell></row>";
} else {
if ($nro == 11) {
break;
}
$data .= "<item id='{$nro}'><cliente>" . $row["razon_social_cliente"] . "</cliente><monto>" . round($row["total_por_cliente"], 2) . "</monto></item>";
}
$nro++;
}
}
if (!$paraGraf) {
$fin = "</rows>";
$cab = "<?xml version='1.0' encoding='iso-8859-1'?><rows>";
} else {
$fin = "</data>";
$cab = "<data>";
}
return $cab . $data . $fin;
}
示例7: challenge
public function challenge()
{
global $cn;
// DB読込み(メンバーテーブルから認証)
$strSQL = "select a.member_id, a.login_pwd as pass, a.login_pwd_md5 as hashed_pass, a.pass_salt, a.name1, a.name2, a.disp_name, a.email, a.nickname, a.api_key, a.force_chpwd, a.login_ok_ymd " . "from v_member_header a " . "where login_id = '{$_REQUEST['email']}' ";
$result = selectQuery($cn, $strSQL);
if ($row = getRow($result)) {
RCMSUser::setLogin($row, $_REQUEST['login_save']);
LoginHistory::write($cn, RCMSUser::getUser());
$_SESSION["password_inputted"] = 1;
return array(true, $_REQUEST['login_save'] == 1);
}
return array(true, $_REQUEST['login_save'] == 1);
}
示例8: contactInfo
function contactInfo($db, $call)
{
$contacts = '';
$q3 = "SELECT ares_contact_type, contact, validity, A.type " . "FROM ares_contact_info A, ares_contact_type B " . "WHERE A.type = B.type AND A.call='" . $call . "'";
//echo "<p>" . $q3 . ",/p>\n";
$r3 = getResult($q3, $db);
while ($row3 = getRow($r3, $db)) {
$xx = $row3[1];
if ($row3[3] < 4) {
$xx = formatNumber($row3[1]);
}
if ($row3[2] == 1) {
$contacts = $contacts . $row3[0] . ": <b>" . $xx . "</b><br>";
} else {
$contacts = $contacts . $row3[0] . ": " . $xx . "<br>";
}
}
echo $contacts;
}
示例9: del_file
function del_file($fid, $user = 0)
{
$del_time = time() + 8 * 3600;
if ($user == 1) {
$sql = "select filepath from files where fid = '{$fid}'";
if ($file = getRow($sql)) {
$path = $file['filepath'];
if (file_exists($path)) {
unlink($path);
// 彻底删除
} else {
$err_msg = "对不起,该文件不存在,请检查文件名!";
}
/*
删除成功,才能修改数据库,否则数据将发生不完整性!此逻辑有些问题
如果文件不存在,但是找到了,说明数据库有记录,此时也应该删除该记录,因为此记录是无效记录
*/
$sql = "delete from files where fid = '{$fid}'";
// 彻底删除
} else {
$err_msg = "对不起,删除失败,该文件可能不存在,请检查文件名,或者稍后再试!";
}
} else {
$sql = "update files set status = 2, del_time = {$del_time} where fid = '{$fid}'";
}
/*print_r($sql);
exit;*/
$result = mysql_query($sql);
if (!$result) {
$err_msg = "对不起,删除失败,数据库繁忙,请稍后再试!";
} else {
if (mysql_affected_rows() == 0) {
$err_msg = "对不起,删除失败,该文件可能不存在,请检查文件名,或者稍后再试!";
}
}
if (isset($err_msg)) {
//echo $err_msg;
return $err_msg;
}
return true;
}
示例10: displayRows
function displayRows($data, $alldata)
{
if (!count($data)) {
return;
}
$titlerow = '
<div class="titlerow">
<div class="span-9">Auth Item</div><div class="span-2">Currently Included</div><div class="span-2">Indirectly Included</div><div class="span-2">Include</div>
</div>
';
$evenodd = array('evenrow', 'oddrow');
$types = array('Operations', 'Op Groups (Tasks)', 'Roles');
foreach (array(2, 1, 0) as $type) {
$panels[$types[$type]] = $titlerow;
$rownum[$types[$type]] = 0;
}
foreach ($data as $datum) {
$panel = $types[$datum['type']];
$panels[$panel] .= '<div class="' . $evenodd[$rownum[$panel]++ % 2] . '">';
$panels[$panel] .= getRow($datum, $alldata);
$panels[$panel] .= '</div>';
}
return $panels;
}
示例11: array
for ($iCt = 0; $iCt < count($names); $iCt++) {
# $savefile = $name;
$savefile = $names[$iCt];
$reg = "/^(\\d{1,3}\\.){3}\\d{1,3},\\s{$savefile},\\s\\d{4}\\/\\d{2}\\/\\d{2},\\s\\d{2}:\\d{2}:\\d{2},\\sW3SVC1,\\sPOPPY,\\s192\\.168\\.30\\.17,\\s\\d{1,5},\\s\\d{1,5},\\s\\d{1,5},\\s\\d{1,5},\\s\\d{1,5},\\s.{3,4},\\s.*\\/(login\\.asp|HqMain\\.asp|HallMain\\.asp|HqMenu\\.asp),/i";
$files = array();
$drc = dir($directory);
while ($fl = $drc->read()) {
if ($fl == '.' or $fl == '..') {
continue;
}
# filesに追加
$files[] = $directory . "/" . $fl;
}
sort($files);
for ($i = 0; $i < count($files); $i++) {
getRow($files[$i], $reg, $savefile);
}
}
function getRow($file, $reg, $savefile)
{
echo $file . "::" . $savefile . "<BR>";
$fp = fopen($file, 'r') or die('end');
$result = array();
while (!feof($fp)) {
$row = fgets($fp, 1024);
if (preg_match($reg, $row)) {
$result[] = $row;
echo $row . "::" . $savefile . "<BR>";
}
}
fclose($fp);
示例12: header
<?php
/*
文件预览
改进:使用id传递不够安全,容易被用户自己输入id查看
使用自己的加密技术
或者使用md5加密id等,由于加密不可逆,故数据库需要存储此md5值!
window.location更加不安全,把路径名等,全部暴露了,
需要改进,使用加密技术生成!
*/
header('content-type: text/html; charset=utf-8');
require "../include/init.php";
require_once '../include/file.func.tool.php';
$fid = $_GET['fid'] + 0;
// 安全检查
$sql = "select * from files where fid = '{$fid}'";
if ($file = getRow($sql, $conn)) {
echo "<script> window.location=\"" . $file['filepath'] . "\";</script> ";
// echo nl2br(htmlentities(file_get_contents($file['filepath']))); 乱码,格式也不对
} else {
echo "id 非法!";
}
示例13: while
while ($row2 = getRow($r2, $db)) {
//echo $district . ',' . $row2[0] . "<br>\n";
$q3 = 'SELECT `aresmem`,`drillsnum`,`drillshrs`,`psesnum`,`pseshrs`,`eopsnum`,`eopshrs`,`aresopsnum`,`aresops` ' . "FROM `arpsc_ecrept` WHERE `county`='" . $row2[1] . "' AND `period`=" . $period;
$r3 = getResult($q3, $db);
if ($row3 = getRow($r3, $db)) {
$hours = $row3[2] + $row3[4] + $row3[6] + $row3[8];
$value = $hours * 18.11;
$lastperiod = $period - 1;
$q4 = "SELECT `aresmem` FROM `arpsc_ecrept` WHERE `county`='" . $row2[1] . "' AND `period`=" . $lastperiod;
$r4 = getResult($q4, $db);
if ($row4 = getRow($r4, $db)) {
$change = $row3[0] - $row4[0];
} else {
$q4 = "SELECT `aresmem` FROM `arpsc_ecrept` WHERE `county`='" . $row2[1] . "' AND `period`=0";
$r4 = getResult($q4, $db);
if ($row4 = getRow($r4, $db)) {
$change = $row3[0] - $row4[0];
} else {
$change = " ";
}
}
echo "\t<tr>\n";
if ($district != $olddistrict) {
echo $district;
$olddistrict = $district;
}
echo ',' . $row2[0] . ',' . round($hours) . ',' . round($value) . ',' . $row3[0] . ',' . $change . ',' . $row3[1] . ',' . $row3[2] . ',' . $row3[3] . ',' . $row3[4] . ',' . $row3[5] . ',' . $row3[6] . "<br .>\n";
} else {
if ($row2[0] == 'Arenac') {
if ($district != $olddistrict) {
echo $district;
示例14: COUNT
$q6 = "SELECT COUNT(*) FROM `arpsc_ecrept` WHERE `period`=";
$testperiod = (int) $p9 + 1;
$q6 = $q6 . $testperiod;
$r6 = getResult($q6, $db);
$row6 = getRow($r6, $db);
if ($row6[0] > 0) {
$url = "Summary.php?period=" . $testperiod;
echo " <td class=\"" . $rowclass . "\"><a href=\"" . $url . "\">Fwd 1m></a></td>\n";
} else {
echo " <td class=\"" . $rowclass . "\">Fwd 1m></td>\n";
}
$q6 = "SELECT COUNT(*) FROM `arpsc_ecrept` WHERE `period`=";
$testperiod = (int) $p9 + 3;
$q6 = $q6 . $testperiod;
$r6 = getResult($q6, $db);
$row6 = getRow($r6, $db);
if ($row6[0] > 0) {
$url = "Summary.php?period=" . $testperiod;
echo " <td class=\"" . $rowclass . "\"><a href=\"" . $url . "\">Fwd 1Q>></a></td>\n";
} else {
echo " <td class=\"" . $rowclass . "\">Fwd 1Q>></td>\n";
}
echo " </table>\n";
echo " <p> </p>\n";
echo " </center>";
echo " </div>\n\n";
sectLeaders($db);
footer($starttime . "Z", $maxdate, "\$Revision: 1.0 \$ - \$Date: 2008-10-15 15:08:57-04 \$");
?>
</div>
</body>
示例15: usort
global $array, $column;
$array = $arr;
$column = $col;
usort($array, "cmp");
return $array;
}
$ip = $_SERVER['REMOTE_ADDR'];
$entry_line = $ip . "\r\n";
$fp = fopen('logs.txt', 'a');
fputs($fp, $entry_line);
fclose($fp);
$file = file('logs.txt');
$counts = array_count_values($file);
$ipList = array_unique($file);
$array = array();
$ind = 0;
for ($i = 0; $i < count($file); $i++) {
if (array_key_exists($i, $ipList)) {
$array[$ind][0] = $ipList[$i];
$array[$ind++][1] = $counts[$ipList[$i]];
}
}
$array = razor_sort($array, 1);
$text = '';
for ($i = count($array) - 1; $i >= 1; $i--) {
$text .= getRow($array[$i][0], $array[$i][1]);
}
echo getTable($text);
?>
</body>
</html>