This is the code what tried.
Data is divided and displayd no.of pages too...
But, when i click 2link/page, its showng sorry no data found.
Help me...
<?php
$name = $_POST['name'];
$category = $_POST['category'];
$con = mysql_connect("localhost","zxzx","xzxz") or die("Unable to connect");
$db = mysql_select_db("test",$con) or die("Unable to select DB");
if(isset($_GET['page']))
{
$page = $_GET['page'];
}
else
{
$page = 1;
}
$sf = ($page-1) * 16;
$sql = " SELECT * FROM budget where NAME=\"$name\" LIMIT ".$sf.",16 ";
$rs = mysql_query($sql,$con);
if(mysql_num_rows($rs) == 0)
{
echo("<p class=\"no\">Sorry, NO Records Found..!</p>
<p class=\"no\">Please try with another Name.</p>
");
}
else
{
echo "<table id='main-table' cellspacing='0' cellpadding='0' class=\"table1\">
<tr class=\"rowh\">
<td>Date</td>
<td>Name</td>
<td colspan=\"2\"> ACTIONS </td>
</tr>";
while ($row=mysql_fetch_array($rs))
{
echo ("<tr><td class=\"rowr\">$row[DATE]</td>");
echo ("<td class=\"rowr\">$row[NAME]</td>");
echo ("<td ><a class=\"rowrl\" href=\"edit_form.php?number=$row[iD]\"> Edit </a></td>");
echo ("<td ><a class=\"rowrl\" href=\"delete.php?number=$row[iD]\" onclick=\"return confirm(' Do you really want to DELETE ?');\"> Delete </a></td></tr>");
}
}
</table>
</td>
</tr>
</table>
<?php
$sql1 = "SELECT COUNT(NAME) FROM BUDGET where NAME=\"$name\" ";
$rs1 = mysql_query($sql1,$con);
$row1 = mysql_fetch_row($rs1);
$total = $row1[0];
$tp = ceil($total/16);
for($i = 1; $i <= $tp; $i++)
{
echo "<a href='edit.php?page=".$i."'>".$i."</a> ";
}
?>