|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
php5 - Pagination inside the menu
hi,
this is my menu code menu.php <html> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td align="center" valign="top"> <ul id="nav" class="dropdown dropdown-linear"> <li> <a href="#" id="pagination">pagination</a> </li> </ul> </td> </tr> </table> <p> </p> <table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr valign="top"> <td> <div id="result" class="functions"> </div> </td> </tr> </table> <script type="text/javascript"> $.ajaxSetup ({ cache: false }); var ajax_load = "<img src='images/load.gif' class='loading' alt='loading...' />"; //load() functions $("#pagination").click(function(){ $("#result").load("pagination.php"); }); </script> </body> </html> i used css to display the result and pagination.php <?php //connection to db will goes here $page_name="zpagination.php"; $start=$_GET['start']; if(strlen($start) > 0 and !is_numeric($start)){ echo "Data Error"; exit; } $eu = ($start - 0); $limit = 10; // No of records to be shown per page. $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; $query2=" SELECT * FROM footer_languages"; $result2=mysql_query($query2); echo mysql_error(); $nume=mysql_num_rows($result2); $query=" SELECT * FROM footer_languages limit $eu, $limit "; $result=mysql_query($query); echo mysql_error(); while($row = mysql_fetch_array($result)) { print " ".$row['languages'] .""; } echo "</table>"; if($nume > $limit ){ echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>"; if($back >=0) { print "<a href='$page_name?start=$back'>PREV</font></a>"; } echo "</td><td align=center width='30%'>"; $i=0; $l=1; for($i=0;$i < $nume;$i=$i+$limit){ if($i <> $eu){ echo " <a href='$page_name?start=$i'>$l</font></a> "; } else { echo "$l</font>";} $l=$l+1; } echo "</td><td >"; if($this1 < $nume) { print "<a href='$page_name?start=$next'>NEXT</font></a>";} echo "</td></tr></table>"; } ?> when pagination is clicked in menu the out put from pagination page will be displayed inside div class but when next or prev is clicked it is moving to pagination page i need all the results to be displayed inside div given in menu.php can any one heplp me in this , i am waiting for replay Thanking u in advance |
|
#2
|
|||
|
|||
|
the problem is solved
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > php5 - Pagination inside the menu |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|