我从此网站http://www.frequency-decoder.com/demo/table-sort-revisited/paginate/
中提取了分页。这是我的桌子。
我删除了从表中删除该记录的链接。
这是我的编码。
<div class="table">
<table id="theTable" class="paginate-2 max-pages-7">
<thead>
<tr>
<th width="460" align="left">User Name</th>
<th width="78">View</th>
<th width="74">Edit</th>
<th width="74" class="last">Delete</th>
</tr>
</thead>
<tbody>
<?php
$find=addslashes($_REQUEST['find']);
$searchquery='';
if($_POST['find']!=''){
$searchquery = "WHERE `varName` OR `varEmail` LIKE '%$find%'";
}
if($find)
{
?>
<?php }
else
{?>
<?php
}
$select_user="SELECT * FROM `tbl_user`".$searchquery;
$select_query=mysql_query($select_user);
$select_num_rows=mysql_num_rows($select_query);
if($select_num_rows>0)
{
while($fetch=mysql_fetch_array($select_query))
{
$fetchuserid=$fetch['intUserid'];
$fetchusername=stripslashes(ucfirst($fetch['varName']));
?>
<tr>
<td><?php echo $fetchusername;?></td>
<td align="center"><a href="user_detail.php?id=<?php echo $fetchuserid;?>">View</a></td>
<td align="center"><a href="edit_user.php?id=<?php echo $fetchuserid;?>">Edit</a></td>
<td align="center" class="last" onclick="return confirm('Are you sure to delete this user?') ;"><a href="delete_user.php?id=<?php echo $fetchuserid;?>">Delete</a></td>
</tr>
<?php
}
}
else{?>
<tr>
<td colspan="4" class="last" align="center"><?php echo "No such records found";?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
问题是,如果我在第三页并删除第三页中的记录,则分页会自动将第一页显示为活动页面。但我需要删除该页面中的记录后第三页应该是活动页面。我怎么能这样做?