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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.