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

  • SEARCH
  • Home
  • 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 9140895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:34:34+00:00 2026-06-17T09:34:34+00:00

I have a page where I render items from my database in reversed chronological

  • 0

I have a page where I render items from my database in reversed chronological order. Last added item is the first item on top of the page.

I use infinite scrolling, so everytime the user hits the bottom, I send pagenumber and resultcount to my server. There I use propel paginate to get the next page.

The problem is, when an user adds a new item on the page it will be added to my database and is the first item on page 1 in my results. So all other results are shifted by 1 position.
Is there a way to tell propel that it should start at offset+1 to ignore the new added element?

A little example:

I have 5 items per page. In this example every item has only a number, so on the page you can see 1,2,3,4,5. Now, a user adds the item 0. My database results w/o pagination is now:
0,1,2,3,4,5 because the new item is added. Now the user hits the bottom of the page and the pagination has the attributes page = 2, items per page = 5 and I will get 5,6,7,8,9. Now my page renders the 5 again. If I could say propel that the initial offset should start after the first item, the result would be ok.

  • 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-17T09:34:35+00:00Added an answer on June 17, 2026 at 9:34 am

    Just an idea, haven’t tried the code myself, but you could add a timestamp to the search criteria and pass it in with the paging so that all search results are restricted to records created before the current search began:

    <?php
    $page = (isset($_GET['page']))?$_GET['page']:1;
    $timeFilter = (isset($_GET['time']))?$_GET['time']:date("Y-m-d H:i:s", time());
    
    $posts = PostQuery::create()
      ->filterByCreatedAt($timeFilter, Criteria::LESS_THAN)
      // add other filters as necessary
      ->paginate($page, $limit);
    // Obviously there is a lot of other things to include, just an example...
    ?>
    <html>
    <head>
      <title>Paging Example</title>
    </head>
    <body>
      <ul id='results'>
        <?php foreach ($posts as $post) {
    
          echo "<li>".$post->getTitle()."</li>";
    
        } ?>
      </ul>
    
      <div id='paging'>
        <?php
        if (!$pager->isFirstPage()) {
          echo "<a href='thisFile.php?page=".$pager->getPreviousPage()."&time=".$timeFilter."'>Previous Page</a>";
        }
    
        // may want to add a page list here...
    
        if (!$pager->isLastPage()) {
          echo "<a href='thisFile.php?page=".$pager->getNextPage()."&time=".$timeFilter."'>Next Page</a>";
        }
    
        ?>
      </div>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two actions set up to get specific items from database as follows:
I have a situation where I render items from server in GWT grid on
Is it possible to render Razor in Html.Raw()? I have a dynamic page being
I have to render some text to a web page. The text is coming
I have my views render to route requests like /controller/action (for instance, /Page/Create), so
I have a form that I don't render as part of HTML page but
I have page where I load different videos.I use jw player as player if
I have page where I use model which can have different types (depending by
I have page which is redirected from htaccess. now I can pass the German
Currently I'm using: <% @items.each do |item| %> <li class=list-item> <%= render :partial =>

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.