php - Zend Paginator: Load each page from Database with Limit and Offset -


I'm using the following code to score on the page

I get the database result 10 Receiving,

P>

  $ result = $ model-> Search (); // SQL Limit 10 $ pgenerator = Zend_Paginator :: factory ($ result ['listing']); $ Paginator- & gt; SetItemCountPerPage (10); $ Paginator- & gt; SetCurrentPageNumber ($ page); $ This- & gt; View- & gt; Pageinator = $ paginator;   

I have around 10,000 records in the database and I am trying to get 10 results for each database request and display.

But for endorsement here, we need to get all the results and need to pass the Zand penguin, which causes a performance problem. So how do I get 10 results per page using the SQL offset and 1,10 ... 11,10 ... 21,10 like

I clicked the 2 page to offset the database You must get the results from and 11,10 as limitations and

I need to bring dynamically each page result from the database. How is it possible?

Can you try

Pagination url on my page:

  $ SetItemCount = 10; $ CurrentPage = $ this- & gt; Parameter () - & gt; FromQuery ('page'); $ NextPage = $ CURRENT_PAGE + 1; $ Result = $ model- & gt; Search ($ Next Page, $ SetItemCount); $ Paginator = Zend_Paginator :: Factory ($ result ['listing']); $ Paginator- & gt; setItemCountPerPage ($ SetItemCount); $ Paginator- & gt; SetCurrentPageNumber ($ page); $ This- & gt; View- & gt; Pageinator = $ paginator;   

I have not tried this personally, I was thinking of moving forward in this way, you have many buffer result set and Iterator .

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -