私は一度にjspaginator
10個の通知を表示し、ページごとに5個の通知を表示するためにgithubから使用しています.しかし、ユーザーの要求に応じてより多くの結果を取得するためのNEXTボタンを提供していません.コード -
$start=0;
$end=10;
$query='select * from notice order by id desc limit '.$start.','.$end.';';
if($query_run=mysql_query($query))
{
$query_num_rows=mysql_num_rows($query_run);
if($query_num_rows==0)
{
echo '<h4>No Notices</h4>';
}else {
echo '<div id="green-contents" class="contents" ">
<table id="mt" cellpadding="0" cellspacing="0" border="0" class="table">
<tr class="header">
<th>
Date Posted
</th>
<th width="55%">
title
</th>
<th>
Posted By
</th>
<th>
Branch
</th>
<th>
Semester
</th>
</tr>';
for($i=0;$i<$query_num_rows;$i++)
{
echo '<tr>
<td>'.mysql_result($query_run,$i,'posted_on').'</td>
<td class="note"><h4><a href="view_notice.php?id='.
mysql_result($query_run,$i,'id').'">';
if(strlen(mysql_result($query_run,$i,'title'))>48)
echo (substr(mysql_result($query_run,$i,'title'),0,45)).'.....';
else
echo mysql_result($query_run,$i,'title');
echo '<td>'.mysql_result($query_run,$i,'posted_by').'</td>
<td>'.mysql_result($query_run,$i,'branch').'</td>
<td>'.mysql_result($query_run,$i,'semester').'</td>';
}
echo '</table>';
}
}else
echo mysql_error();
$start
では、 andを変更し$end
てクエリを再度実行し、次の 10 件の結果を取得するにはどうすればよいでしょうか。