[EN][PHP] Pagination tutorial
Loading...
1,326
Loading...
Uploader Comments (Laimonas171)
see all
All Comments (12)
-
@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...
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 2 months ago
@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 2 months ago
@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 2 months ago
@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 2 months ago
thanksssss aa lottttt!......
the best tutorial on pagination!!!!..
mrdevi 7 months ago
@mrdevi nice to hear that :)
Laimonas171 2 months ago