Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7991999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:27:05+00:00 2026-06-04T13:27:05+00:00

I am trying to call pages using Zend_Paginate() on a query that loads based

  • 0

I am trying to call pages using Zend_Paginate() on a query that loads based on a GET search string the query essentially does the following:

SELECT * FROM table WHERE column LIKE '%searchstring%' OR alt_column LIKE '%searchstring%';

The query works fine when called via search/submit text form and the URL returns something similar to

URLINK.php?search=searchstring

However when trying to move onto the next page the program dumps me back to the paginate alternate URL (used for errors or no page display)– hope this last line makes sense it is late and am doing my best to type this up with transparency.

What is the best method when using paginate against URL.php?search=searchstring“?

A bit more on the call to the url

//search query 
$search = searchQuery('search', 'list_sql_rows.php');
$results - searchTable($dbRead, $search);

search method using the variables above in the order below

if(isset($_POST['submit_search'])) { $searchstring = $_POST['searchstring'];
if($searchstring) { header('Location: results.php?search=' . $searchstring); } }

This bit works well, but when I try to call the results.php?page=2 with paginator the system reverts me to the fall back URL list_sql_rows.php as mentioned above. Any thoughts/comments are appreciated.

Just to clarify a search field/form from the search.php page sends the $searchstring to the results.php page via $_POST && $_GET as fail safe. The get method sends the $searchstring in the URL header so the results of the search DO work on the first page results.php?search=$searchstring. This works just fine. The pagination seems to lose the $searchstring, and I wonder if this is due to a loss of the $_POST/$_GET when paginator begins to ‘paginate’ it returns URL results.php?page=2 so it seems $_GET may not be the method of choice?

UPDATE
On the write track now paginate works it is my link structure that is broken.
_results_samples.php?search=robert&page=4_ will in fact return page 4 of the paginated results using the word ROBERT

SOLUTION FOUND VIA variant suggestion by ROCKYFORD
variant of recommended method by first persisting $searchstring
change to paginate links as shown below

<a href='" . $_SERVER['PHP_SELF'] . "?search=" . $searchstring . "&page={$page}'>$page</a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:27:06+00:00Added an answer on June 4, 2026 at 1:27 pm

    you need to make sure you preserve the query strings between requests, use Zend_Session_Namespace or Zend_registry.

    Everytime Zend_Paginator loads a page when using the DbTableSelect or DbSelect adapters it has to hit the db with the query, it just changes the limit option.

    Or you could just dump the whole query result into a Zend_Paginator_Adapter_Array and it will page through the array.

    [edit]
    you are going to have to persist the query string between requests someway so you can put it back in the url string, I usually use Zend_Registry, but then I use the whole MVC stack. You don’t seem to be using the whole stack so you’ll need another method, probably $_SESSION would work. I’m sure there are many other ways to persist this data.

    P.S. you didn’t mention which adapter you are using so I’m making some assumptions.

    [edit]
    Personally I always use $_post for this when possible to avoid all this, only seem to have this problem with $_get.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call ScriptManager.RegisterStartupScript from page A so that when page B loads
I know that I can call a page method with jquery using the following
I am trying to get a list of my pages and applications using the
I'm trying to call a Page Method using a jQuery 'attached' event function, in
I am trying to call the stored procedure using subsonic and getting Object Reference
Using httplib2 and urllib2, I'm trying to fetch pages from this url, but all
I'm trying to send a Json array over using an AJAX call to a
I'm trying to generate some XML for a jQuery.get (AJAX) call, and I'm getting
I have a string parameter I pass around using the querystring, I'll call it:
I am trying to get stock prices by scraping google finance pages, I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.