Hi. I've just written a code to show a photogallery but I've a simple question. I want to show only 30 images on the screen and make a buttom that point to the 30 others (a button like this one : |ยป| ) . Is this a way to do that easyly ? And another id is to make alias (photos are order by alphabetical name) for each group of photos (A for photos beginning by A, etc ) and that show the appropriate photos. Thanks for your help.๐
Yes there is. Use limit and offset in your SQL queries to handled how many get displayed. Use "order by" to make them ordered alpha. Use "like" or "ilike" (depends on your database) to only show photos starting with "a" etc. See the SQL documents on your database for specifics.
Frag
You need to add this code at the end of your SELECT query : ... LIMIT $offset, 30
then, you can just set the value of your $offset in the 'next' url: next.php?offset=x
Checkout http://www.devarticles.com/art/1/110 It shows you how to build a MySQL paging class with PHP...