below is my pagination code to display pagination It working and also display pages properly.
but the problem is when i click on page2 it generates an error.
now i debug the code...and find prob... problem is the query is not getting where condition .......
for ex-- the pagination generates pages like this...
1-2-3-4-Next-Last
When I click on page2 or page3 or lastpage the query generates error like
Undefined index: city Undefined index: state
The query is not fetching where clause.
plz tell how to resolve this error...
<?php
$page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
$limit = 2;
$startpoint = ($page * $limit) - $limit;
$statement = "news";
mysql_set_charset('utf8');
$cit = $_GET['city'];
$sta = $_GET['state'];
$sql="select id,story,headline,photo from {$statement} where state_id = '$sta' and city_id = '$cit' order by id desc LIMIT {$startpoint} , {$limit}";
$query=mysql_query($sql);
?>
<?php echo $Admin->pagination($statement,$limit,$page); ?>