paparts Posted August 7, 2008 Share Posted August 7, 2008 http://www.lotsofcode.com/php/php-array-pagination.htm I am using this code for my pagination but I'm using the database instead of arrays. I have a text field in w/c i enter a name and page all the results with the name I inputed. It does take effect only on the first page after click next all the names in the database are there. can i ask ideas on how to manage. tnx Quote Link to comment https://forums.phpfreaks.com/topic/118590-php-pagination-with-filter/ Share on other sites More sharing options...
ignace Posted August 7, 2008 Share Posted August 7, 2008 you forgot to pass the name to the second page, save the value of the name inside a hidden input field <input type="hidden" name="name" value="<?php echo $value;?>" /> Quote Link to comment https://forums.phpfreaks.com/topic/118590-php-pagination-with-filter/#findComment-610511 Share on other sites More sharing options...
paparts Posted August 7, 2008 Author Share Posted August 7, 2008 where is that? my code is like this. case 'syslog': isLogin(); $body->assign('show_menu',showMenu()); $getUsername = $_REQUEST["username"]; $getDate = $_REQUEST["date"]; //if($getUsername || $getDate){ if($getUsername || $getDate) { $query = mysql_query("SELECT * FROM syslog WHERE username LIKE '$getUsername%' AND act_date LIKE '$getDate%'"); } else{ $query = mysql_query("SELECT * FROM syslog WHERE username LIKE '$getUsername%' AND act_date LIKE '$getDate%'"); } $myArray = getData($query); if ($count = count($myArray)) { $pages = $pagination->generate($myArray, 10); if (count($pages) != 0) { $pageNumbers = $pagination->links(); $body->assign('sysloglist', $pages); $body->assign('task','syslog'); if($count>10) { $body->assign('pageNumber' , $pageNumbers); } else{ $less = '<font color = "#cccccc">' . '« Prev'. ' ' . ' Next »' .'</font>'; $body->assign('pageNumber' , $less); } } } where should i put the value? Quote Link to comment https://forums.phpfreaks.com/topic/118590-php-pagination-with-filter/#findComment-610531 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.