View Full Version : page numbers?
Clive[STX]
Thu 24th Jul '03, 1:12pm
Im having troubles on creating a per-page script. I want something like this:
download 1
download 2
.......
download 20
page 1, 2, 3, 4....
It will display 20 downloads per page and the page 1,2,3,4 stuff will automatically increment.
I tried using a for loop, but I ended up with nothing
Hellcat
Sun 27th Jul '03, 12:00am
Are you using a MySQL database or are all downloads stored in one single array?
Clive[STX]
Tue 29th Jul '03, 11:02am
Are you using a MySQL database or are all downloads stored in one single array?
stored on a database
Hellcat
Tue 29th Jul '03, 2:19pm
You could just do a SQL statement like
"SELECT * FROM filestable LIMIT $firstrow, $filesperpage"
This will result your downloads beginning from row "$firstrow" and giving you "$filesperpage" entries from there on.
$firstrow might then be something like "$filesperpage * $currentpage" ($currentpage is the pagenumber the user clicked on).
I'm using something close to this there: My Download-Center (http://www.skill-club.com/showpage.php?pid=dl_listfiles&f1=id&f2=name&f3=descr&f4=url&f5=cat&f6=parent&f7=dl_count&df1=cat&dv1=Maps-DM&df2=parent&dv2=UT2003&sort=ASC&sby=name&limit=25&class=en)
qxh
Tue 29th Jul '03, 5:52pm
Just use:
"SELECT * FROM table LIMIT 0, 20" for the first page.
"SELECT * FROM table LIMIT 21, 41" for the second page, etc.
vBulletin® v3.8.0 Beta 4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.