Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

[EN][PHP] Pagination tutorial

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,326
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 3, 2011

In this video you will see how to create pagination tutorial with php and mysq.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (Laimonas171)

  • 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:)

  • thanksssss aa lottttt!......

    the best tutorial on pagination!!!!..

  • @mrdevi nice to hear that :)

see all

All Comments (12)

Sign In or Sign Up now to post a comment!
  • @Laimonas171 In that case, congratulations, you've got a flawless victory and an awesome tutorial. :)

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

  • @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