this code search all data not from current pagination page
<html>
<body>
<div id="content">
<style>
.current {
padding: 2px 5px 2px 5px;
margin: 2px;
border: 1px solid #000099;
font-weight: bold;
background-color: #000099;
color: #FFF;
}
li {
display:inline-block
}
</style>
<?php
include"connection.php";
$start=0;
$limit=5;
$id='';
if(isset($_GET['id']))
{
$id=$_GET['id'];
$start=($id-1)*$limit;
}
{
if(isset($_POST['Submit'])){
$query=mysql_query("select * from users where FirstName like '%$_REQUEST[fullname]%'");}
else{
$query=mysql_query("select * from users LIMIT $start, $limit");}
echo "<table border='1'>
<tr class='tableheader'>
<th>First Name</th>
<th>Last name</th>
<th>User Id</th>
<th>User Name</th>
<th>Password</th>
<th>Email</th>
<th>Created Date</th>
<th>Gender</th>
</tr>";
while($row=mysql_fetch_array($query))
{
echo "<tr class='tablerow'>";
echo "<td>" . $row['FirstName'] ."</td>";
echo "<td>" . $row['LastName'] ."</td>";
echo "<td>" . $row['UserID'] ."</td>";
echo "<td>" . $row['UserName'] ."</td>";
echo "<td>" . $row['Password'] ."</td>";
echo "<td>" . $row['Email'] ."</td>";
echo "<td>" . $row['CreatedDate'] ."</td>";
echo "<td>" . $row['Gender'] . "</td>";
echo "</tr>";
}
echo "</table></div>";
$rows=mysql_num_rows(mysql_query("select * from users"));
$total=ceil($rows/$limit);
echo "<ul class='page'>";
for($i=1;$i<=$total;$i++)
{
if($i==$id) {
echo "<li class='current'>".$i."</li>"; }
else {
echo "<li><a href='?id=".$i."'>".$i."</a></li>"; }
}
echo "</ul>";
?>
<form method="post" id="frm" name="frm" action="testa.php">
<table width="500" border="0">
<tr>
<td>Search here:</td>
<td><input type="text" name="fullname" id="fullname"/></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Search" /></td>
<td> </td>
</tr>
</form>
<form style="width:50%" method="post" id="123" name="1234" >
<tr>
<td>Go To Page:</td>
<td><input type="text" value="" name="pagination" class=""/></td>
</tr>
<tr>
<td><input name="insert" type="submit" class="button" value="go" /></td>
</table>
</form>
<?php
if(isset($_POST['insert'])){
$Number =$_POST['pagination'];
$Number=urlencode($Number);
header ("Location:http://localhost:1234/city/testa.php?id=$Number");
if ($Number >= $i){
header ("Location:http://localhost:1234/city/testa.php?id=1");
exit;
}
}}?>
</div>
</body>
</html>