| 
<?
//create database test and run given sql file db.sql
 //connect your host
 mysql_connect("localhost");
 //your database name
 mysql_select_db("test");
 include("paging.php");
 ?>
 <html>
 <head>
 <title>Test Paging</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <link href="stylesheet.css" rel="stylesheet" type="text/css">
 </head>
 <body>
 <?
 $Obj=new Paging("select * from hotel where status='a'");
 $Obj->setLimit(10);
 $limit=$Obj->getLimit();
 $offset=$Obj->getOffset($_GET["page"]);
 $Obj->setParameter("&name=Test&address=India");
 //set link css
 $Obj->setStyle("redheading");
 $Obj->setActiveStyle("smallheading");
 $Obj->setButtonStyle("boldcolor");
 ?>
 <table border="1">
 <?
 $sql="select * from hotel where status='a' order by hotel_name limit $offset,$limit";
 $rs=mysql_query($sql);
 while($row=mysql_fetch_array($rs)) {
 ?>
 <tr>
 <td class="bodytext">
 <?=$row[hotel_name]?>
 </td>
 </tr>
 <?
 }
 ?>
 </table>
 <?
 //get page links
 $Obj->getPageNo();
 ?>
 </body>
 </html>
 |