in reply to Re^2: how to put links on the bottom of an image gallery
in thread how to put links on the bottom of an image gallery
Hi,
Giving page=15 is a "direct" method by which you can use the argument "page" directly with LIMIT. If you are passing pages as 0, 1, 2, 3 you can multiply it with 15. If its starting with 1, multiply page-1 with 15. Your perl script may look like
Hope this helps :)my $q = new CGI; my $page = $q->param("page") || '0'; #default 0 my $count = $q->param("count") || 15; # more flexibility. you can pa +ss the No of records as count :), defaults to 15 $offset = $page * count; # assumes that page no starts with 0. #$offset = ($page-1) * count; # assumes that page no starts with 1. Co +mment previous line and uncomment this if you wish to start page from + 1 $SQL = "SELECT * FROM your_table ORDER BY id LIMIT $offset, $count"; ... <rest of your code> ...
Cheers !
--VC
There are three sides to any argument.....
your side, my side and the right side.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: how to put links on the bottom of an image gallery
by misc (Friar) on Aug 27, 2007 at 10:08 UTC |
In Section
Seekers of Perl Wisdom