Added: 9 months ago
From: Laimonas171
Views: 1,324
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (12)

Sign In or Sign Up now to post a comment!
  • This is good, it is. Only question I have is: If i'd have 100 rows as you have in my db, but instead of keeping them, I remove the 40 first, the 1st row would have ID of 41, would this pagination fail?

    Since $start = 0; in the beginning, the result should be the same with $start = 10; if the ID's would start @ 41. Right?

    How do we overcome this?

  • @Nabstylez I do not tested, but i'm pretty sure it will run ok, because ID(column) on db is just to get point how much entries are at all on database, and on db First entry(not depends on ID(column)) is entry=0[id] as db entry. So it should work well :)

  • @Laimonas171 As you've built it, I think it's going to fail. Since you put the Least value of $row in $start, and just LIMIT 10, that should mean if you've got ID 40-100;

    page=1 : 40-50

    page=2 : 40-50

    ...

    page=5 : 50-60

    ...

    Get it? :)

  • @Nabstylez I know what you want to say, and i'm pretty sure that it works well. SQL counts ENTRIES that means if you have 10 entries from 1 to 10 it mean you have 10 entries from 0 to 9, if you have 10 entries from 10 to 15 and from 20 to 25 it still means that you have 20 entries and LIMIT show amount of entries from DB beginning no matter what you added or deleted from it. Also just tested 10 entries with deleted some entries WORKS PERFECTLY:)

  • @Laimonas171 In that case, congratulations, you've got a flawless victory and an awesome tutorial. :)

  • Comment removed

  • thanksssss aa lottttt!......

    the best tutorial on pagination!!!!..

  • @mrdevi You'r welcome : ) Please click subscribe (I really need that) Also you can ask for tutorial, I will try to make one : )

  • @mrdevi nice to hear that :)

  • very nice tutorial, thx!

  • @rainy1505 your welcome :)

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more