Jump to content


Photo

10 Records per page. If there is >10 records, make a new page etc...


  • Please log in to reply
7 replies to this topic

#1 Flukey

Flukey
  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 18 April 2006 - 10:56 PM

Hey guys,

Basically, can someone please point in the right directon to do the following:

I have a table i extrapolate data from. I want to display 10 records per page, if there is more than 10 records, then page 2 is created, if there is more than 20 records than page 3 is created etc.....

How does one do this?

Such as a forum, where post 11 goes on to page 2, post 21 goes onto page 3 etc....

Thanks,

Regards,

Flukey

#2 acey99

acey99
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 18 April 2006 - 11:24 PM

this an sql statement ?


#3 Flukey

Flukey
  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 18 April 2006 - 11:37 PM

[!--quoteo(post=366243:date=Apr 19 2006, 12:24 AM:name=Acey)--][div class=\'quotetop\']QUOTE(Acey @ Apr 19 2006, 12:24 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
this an sql statement ?
[/quote]

to do?

i'm using sql to get the data:

SELECT * FROM posts


#4 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 18 April 2006 - 11:47 PM

[a href=\"http://www.phpfreaks.com/tutorials/43/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/43/0.php[/a]
PHP Ninja

#5 Flukey

Flukey
  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 18 April 2006 - 11:55 PM

[!--quoteo(post=366247:date=Apr 19 2006, 12:47 AM:name=Caesar)--][div class=\'quotetop\']QUOTE(Caesar @ Apr 19 2006, 12:47 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
[a href=\"http://www.phpfreaks.com/tutorials/43/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/43/0.php[/a]
[/quote]

Ah, fantastic!

Thanks a lot, i appreciate your help. My apologies for not finding that link, to be honest, i didn't know it was called 'Pagination'. So no wonder i found no results! :P

Thanks again

Flukey :)

#6 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 19 April 2006 - 12:14 AM

You're welcome...No problem. Happy coding!
PHP Ninja

#7 Flukey

Flukey
  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 19 April 2006 - 06:11 AM

[!--quoteo(post=366257:date=Apr 19 2006, 01:14 AM:name=Caesar)--][div class=\'quotetop\']QUOTE(Caesar @ Apr 19 2006, 01:14 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
You're welcome...No problem. Happy coding!
[/quote]

cheers :D I won't implement the pagination until later on. I'll report back if i get it working :)

#8 reaper7861

reaper7861
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 19 April 2006 - 11:17 AM

[!--quoteo(post=366247:date=Apr 18 2006, 06:47 PM:name=Caesar)--][div class=\'quotetop\']QUOTE(Caesar @ Apr 18 2006, 06:47 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
[a href=\"http://www.phpfreaks.com/tutorials/43/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/43/0.php[/a]
[/quote]

Agrees its perfect.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users