sanku has asked for the wisdom of the Perl Monks concerning the following question:
OUT PUT:#!/usr/bin/perl use CGI; use DBI; print "Content-type:text/html\r\n\r\n"; $buffer=$ENV{'QUERY_STRING'}; ($start,$end,$next)=split(/&/,$buffer); if($next > 0){$next1=$next+1;} $dbuser="root"; $dbpass="root"; $dsn="DBI:mysql:backupprocess;host=localhost"; $mysql->disconnect if $mysql; $mysql=DBI->connect($dsn,$dbuser,$dbpass); $sth2=$mysql->prepare("select * from subscribermis"); $sth2->execute(); $rv = $sth2->rows; if($buffer=~/MM/){$sth1=$mysql->prepare("select * from subscribermis l +imit $start,$end");} else{$start=0;$end=2;$sth1=$mysql->prepare("select * from subscribermi +s limit $start,$end");} $sth1->execute(); print "<body ><center><table border=1><tr bgcolor='#35b5fe'><td align= +center ><font color='#ffffff' size='2'>Date</ font></td><td align=center ><font color='#ffffff' size='2'>Count</font +></td> <td align=center><font color='#ffffff' size='2'>utl</font></td><td ali +gn=center><font color='#ffffff' size='2'>celtel</font></td> </tr>"; while(@arr=$sth1->fetchrow_array()) { print "<tr><td align=center><font class='snewheads'>".$arr[$i]."</font +></td> <td align=center><font class='snewheads'>".$arr[$i+1]."</font></td> <td align=center><font class='snewheads'>".$arr[$i+2]."</font></td> <td align=center><font class='snewheads'>".$arr[$i+3]."</font></td></t +r>"; } print"</table><br><br><br>"; $ss=$rv/2; $i = 0; $j = 0; for($j=1;$j<=($ss);$j++){ $i=$i+2; $end=$i; $end1=2; $start=$end-2; print "<a href=mm1.pl?$start&$end1&MM>$j</a>";
This out put shows without previous and next but i need it with both previous and next option like in google if number of pages is more than 5. but expected out putDate Count utl celtel 1 364922200 1 1 2 74902999 1 1 1234567
Date Count utl celtel 1 364922200 1 1 2 74902999 1 1 <<12345>>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: page by page problem
by dHarry (Abbot) on Jan 07, 2009 at 13:40 UTC |