Re: i need ur help about pagenation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thanks for reply but i need pagenination through classes/function.reply

--- On Wed, 1/28/09, Suman Rai <sumanraic001@xxxxxxxxx> wrote:
From: Suman Rai <sumanraic001@xxxxxxxxx>
Subject: Re:  i need ur help about pagenation
To: php-objects@xxxxxxxxxxxxxxx
Date: Wednesday, January 28, 2009, 10:13 AM










    
            Hello Kashi,



Check out this

Just put



#----------- --------- from here---

<?php

$page="yourpage. php";



$PageNo=$_REQUEST[ 'PageNo'] ;



if(!isset($PageNo) ) {                        



$PageNo = 0;



}



$eu = ($PageNo - 0); 



$limit = 15;                                



$this1 = $eu + $limit; 



$back = $eu - $limit; 



$next = $eu + $limit; 



$sql="SELECT * FROM tablename";



$result=mysql_ query($sql) or die(mysql_error( ));



$total=mysql_ num_rows( $result);



$sql2="SELECT * FROM tablename limit $eu, $limit";



$result2=mysql_ query($sql2) or die(mysql_error( ));



$count2=mysql_ num_rows( $result2) ;



if($count2>= 1){



?>

#----------- --------- ------- to here in the top of the table where your data will displayed



Display Table Data here Like



Name   | Address  | Phone

 

wihile loop { 



etc.



}



<?php

}

?>



//Paging goes here



Put below code for page navigation anywhere of your page but not before the above code.



//Anchor for previous link

                                        <?php



        if($back >=0) { 



        echo"<a href=$page?PageNo= ".$back." >Previous< /a>";



        }        ?>    



//Anchor for page numbers



                                        <?php



$i=0;



$l=1;



for($i=0;$i < $total;$i=$i+ $limit){



if($i <> $eu){



echo "<a href=$page?PageNo= ".$i.">$l< /a> ";



}



else { echo "$l";}



$l=$l+1;



}



?>



//Anchor for Next



 <?php



        if($this1 < $total) { 



echo "<a href=$page?PageNo= ".$next." >Next</a> ";



}



?>



Regards & Thank You,



Suman K. Rai

Cell: +977 98040 25616

rai.suman@yahoo. com | sumanrai1980@ gmail.com

www.raisuman. myplace.com



--- On Mon, 1/26/09, kashi kashan <ksncool@yahoo. com> wrote:



From: kashi kashan <ksncool@yahoo. com>

Subject:  i need ur help about pagenation

To: php-objects@ yahoogroups. com

Date: Monday, January 26, 2009, 10:55 PM



I m beginner in php so didn¢t know the right syntax of php

and now I have a problem that I want to do pagination in my display page with using class and function. So

can any one of you help me?? rep as soon as possible.



      



[Non-text portions of this message have been removed]



------------ --------- --------- ------



Are you looking for a PHP job? Join the PHP Professionals directory Now!

http://www.phpclass es.org/professio nals/Yahoo! Groups Links



[Non-text portions of this message have been removed]




      

    
    
	
	 
	
	








	


	
	


      

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux