Raised This Month: $ Target: $400
 0% 

php Page in descending order


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
tommie113
AlliedModders Donor
Join Date: Oct 2013
Old 12-05-2015 , 14:59   Re: php Page in descending order
Reply With Quote #11

It is not that hard in my opinion.
It needs a small bit of math to decide the ammount of pages depending on your row count per page.
Then its a matter of limiting your sql queries.
Example page 1: {sql query} LIMIT 30;
Example page 2: {sql query} LIMIT 30 OFFSET 30;
Example page 3: {sql query} LIMIT 30 OFFSET 60;
Etcetera.

LIMIT is row count per page.
OFFSET is where to start.
You would run query 1 if page=1
Run qeury 2 if page=2
This can also be done with math/variables to define the offset in the query.
Example: offset = (pagenumber-1)*30
Will result in offset 0 for page 1, 30 for page 2, etc.

Edit: I think it's also wise to either show date in normal date-time forms or don't show it. Date in this form is completely useless for both you and users that land on the page.
__________________
No longer taking requests due to lack of time and interrest.
Only helping out with minor things through forum.

Last edited by tommie113; 12-05-2015 at 15:05.
tommie113 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode