0

Hi,Pagination Problem : It shows the pages i.e 1,2,3 as number of records, but further records are not shown when clicked on page 2 further 3 and soo on..

Database Connectivity:

$query = "SELECT * FROM photos ORDER BY id DESC limit 1,2";

$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
	$image_stat1= $row["image_path"];
	
?>

2nd Php tag which shows the pages

$sql = "SELECT COUNT(id) FROM photos"; 

$rs_result = mysql_query($sql);
$row = mysql_fetch_row($rs_result); 
$total_records = $row[0]; 
$total_pages = ceil($total_records / 2); 
 
for ($i=1; $i<=$total_pages; $i++) { 
echo "<a href='gallery_retrieve.php?idd=".$i."'>".$i."</a> "; 
}; 
?>
</table>
</form>
2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by diafol
0

You don't include the code for processing the querystring (idd). Can I suggest you search this forum for 'pagination'? It has been covered a million times every week since I've been here. *sigh*

0

Ardav: Kindly paste the link of the specific querystring which u are talking about ,so that i may directly jump to it for the solution which i am finding out.
Thanks

0

Me > You don't include the code for processing the querystring (idd)

You > Kindly paste the link of the specific querystring which u are talking about gallery_retrieve.php?idd=... Where is the code showing how you deal with the $_GET variable?

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.