Jump to content

Pagination to display search results


networkthis

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.