Log in

View Full Version : Dynamic pagination?



acctman
10-27-2008, 09:35 PM
I'm looking for a dynamic/ajax pagenation script that will work with a database. I'm retrieving image-id numbers and need to show 20 images <img src "image-ID"> per page then have a page numbers at the bottom for going to the next pages. But i also would like for the page not to stay static. refresh the images without the page moving


this is an example of how my script currently display the images. I stripped out all the extra HTML coding but with the current coding it shows all of the users friends on one page.



<!--[Loop Start QUERY:SELECT * FROM $favstable LEFT JOIN $membtable ON m_id=f_fav LEFT JOIN $picstable ON f_fav=i_user WHERE f_user=$en[m_id] AND i_status=2]-->

<a href='<%dir%>view/<%m_user%>.html'>
<img src='<%dir%>images/small/<%f_fav%>-<%i_id%>.jpg' border=1></a>
<a href='<%dir%>view/<%m_user%>.html'>
<%m_user%></a>
<!--[Loop End]-->


its a template script that allows php queries to be inserted very easy.

thanks in advance

patrick

Medyman
10-27-2008, 10:56 PM
Have you seen this (http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm)?

acctman
10-28-2008, 12:20 AM
Have you seen this (http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm)?
the problem with that is I don't want to create a page with hundreds of images and text. i would prefer to do it the traditional way

Medyman
10-28-2008, 04:47 PM
the problem with that is I don't want to create a page with hundreds of images and text. i would prefer to do it the traditional way

You don't have to. Use ajax to dynamically display the images/text.

acctman
10-28-2008, 05:07 PM
You don't have to. Use ajax to dynamically display the images/text.

but if there is 200-300 images the load time into a page becomes too much

Medyman
10-29-2008, 12:45 AM
but if there is 200-300 images the load time into a page becomes too much

Then, what exactly are you trying to do? By using AJAX, I mean return the next "page" of 20 images dynamically. When someone clicks "next", query the database for the next 20 images and load them. This actually reduces the load time. You wouldn't be loading all 200 images at once.