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


PHP Pager::incr方法代碼示例

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


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

示例1: isset

<?php 
echo '<tr class="header" style="height: 10px"><td class="header" style="text-align: left;"><a class="header" href="?bug=' . $_GET['bug'] . '&amp;pick=new">New</a></td>';
?>
<td style="text-align:right">
<form action="#" method="post" class="inline">
<span><input type="text" name="search" /></span>
</form>
</td></tr>

<?php 
$search = isset($_POST['search']) ? ' WHERE bug_name LIKE \'%' . $_POST['search'] . '%\'' : '';
$pager = new Pager();
$query = "SELECT COUNT(*) AS max FROM " . TBUGS . " {$search}";
$r = query($query);
$row = mysql_fetch_array($r);
$pager->max($row['max']);
$limit = "LIMIT " . $pager->from() . "," . $pager->incr();
$query = "SELECT * FROM " . TBUGS . " {$search} ORDER BY bug_id DESC {$limit}";
$result = mysql_query($query) or die("MySQL Error: " . mysql_error());
while ($row = mysql_fetch_array($result)) {
    $odd = $x++ % 2;
    echo '<tr class="row r_' . $odd . '"><td class="row" colspan="2"><a href="?bug=' . $_GET['bug'] . '&amp;pick=' . $row['bug_id'] . '">' . $row['bug_id'] . ' - ' . translucate($row['bug_name'], 20) . '</a></td></tr>';
}
echo '<tr class="footer"><td colspan="2">';
$pager->display();
echo '</td></tr>';
?>

</table>
</body>
</html>
開發者ID:Kjir,項目名稱:amsn,代碼行數:31,代碼來源:pickbug.php

示例2: Pager

<?php

include '../../config.inc.php';
include '../common.inc.php';
include '../../libs/url.class.php';
include '../../libs/bugreport.class.php';
include '../../libs/func.lib.php';
include '../../libs/mail.lib.php';
include '../../libs/pager.class.php';
include '../../libs/tabler.class.php';
include '../../libs/bug.class.php';
$pager = new Pager();
$pager->incr(50);
$query = "";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>aMSN Bug Database</title>
<link rel="stylesheet" href="../main.css" type="text/css" />
<script type="text/javascript" src="../main.js"></script>
</head>
<body>
<div class="navig">
<?php 
include 'navig.inc.php';
?>
</div>
<div class="top">
<?php 
開發者ID:Kjir,項目名稱:amsn,代碼行數:31,代碼來源:index.php


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