createing dynamic new pages
Collapse
X
-
The solution depends on what type of database you are using.
MySQL supports the LIMIT syntax, which is used like this:
This will retrieve 30 rows beginning at row 6.Code:SELECT * FROM images LIMIT 5,30
MSSQL has the TOP clause, and other DBMS have similar syntaxes.Leave a comment:
-
You'll probably need to run two queries against your database. The first to get the count of images that may be returned. The second to return x images per page. Knowing these two values you should be able to estimate the total number of pages the images are spread over. As you move from page to page alter the second query to return the appropiate subset of images.Originally posted by jungabungaHeya guys,
I an having trouble building a page that dynamically expands.
The page fundimentally works fine, but at the moment i am storing about 45 image locations in my db.
I am having real difficulty finding some understandable examples of how to account for a potentially infinite number of images so the user can view the gallery say 20 images at a time on a page to cut down loading - currently thay are all on one page. i know, not good :( .
thx again for ur helpLeave a comment:
-
createing dynamic new pages
Heya guys,
I an having trouble building a page that dynamically expands.
The page fundimentally works fine, but at the moment i am storing about 45 image locations in my db.
I am having real difficulty finding some understandable examples of how to account for a potentially infinite number of images so the user can view the gallery say 20 images at a time on a page to cut down loading - currently thay are all on one page. i know, not good :( .
thx again for ur helpTags: None
Leave a comment: