Jump to content

[SOLVED] Pagination won't work?


CloudSex13

Recommended Posts

Hi, thanks for reading. For some reason, I can't identify why the pagination will not appear on my page. Can anyone quickly proof my code? Maybe I got tired...

 

lol.

 

Erg... thanks.

 

$things = mysql_query("SELECT * FROM Things WHERE AccountID='$saID'");

$thingamount = mysql_num_rows($things);
$perpage = 5;
$t = 0;

while ($t <= 5 && $row == mysql_fetch_row($things))
{
$t+=1;
$i+=1;
}

for ($N = 1; $n >= ($thingamount / $perpage); $n++)
{
  $thingpages = "[{$n}]";
}

 

I'm echoing $thingpages below.

Link to comment
https://forums.phpfreaks.com/topic/154142-solved-pagination-wont-work/
Share on other sites

hmmm, that's not how I would have done it.

 

you can change this...

<?php
while ($t <= 5 && $row == mysql_fetch_row($things))
{
$t+=1;
$i+=1;
}

to this...

<?php
while ($t <= 5 && $row == mysql_fetch_row($things))
{
$t++;
$i++;
}

 

besides that I can't see anything wrong, I'm still waking up lol

Honestly, that code is a mess and looks like it is done wrong. I would suggest reading a pagination tutorial which one can be found here

 

As it does seem you do not know how to do it. You should only pull data out of the query that you need, not everything, which the above tutorial will show you how to do.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.