networkthis Posted October 27, 2008 Share Posted October 27, 2008 Ok here it goes... I am using pagination to display the results of my mysql query into only 25 rows per page. The pagination works great. However... I have implemented a simple mysql search into it similar to <?php ("SELECT * FROM table WHERE name LIKE '%$value%' ") ?> Here is my problem...everytime that I use my pagination links at the bottom of the page without a search they work great. I can get them to display the proper amount of pages for each search at the bottom of the page. But once I click the pagination link it reverts back to querying all the results, not just what I have put in the search. I have a $_POST['value'] at the top of the page to take the input from the original search page...it works great displaying results. Until the pagination link is hit at the bottom of the page. Is there a way to keep the $_POST['value'] alive all the time page is in use...until there is another search? I am using pagination links like this http://www.mysite.com?pagenumber=1 is there maybe a way to take the $_POST['value'] and maybe have a ?seach=$value at the end of the pagenumber=1 instead. I am really at a loss at this point. I am fairly new to php and appreciate all your help. Thank you Link to comment https://forums.phpfreaks.com/topic/130213-pagination-to-display-search-results/ Share on other sites More sharing options...
Jeremysr Posted October 27, 2008 Share Posted October 27, 2008 I would make the search form use the GET method (<form action="get">), then when linking to the next page, have the search result in the URL like you said. Link to comment https://forums.phpfreaks.com/topic/130213-pagination-to-display-search-results/#findComment-675293 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.