本文整理汇总了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'] . '&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'] . '&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>
示例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