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 8866049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:40:53+00:00 2026-06-14T16:40:53+00:00

I have an AJAX system that fetch posts from database and then create DIVs

  • 0

I have an AJAX system that fetch posts from database and then create DIVs in my layout to put them. When te user reachs the end of the page then many other posts will be loaded by the API. The problem is, how can I get the following 10 posts that are just the previously posts of the last that is already loaded? The same thing I want to happen when I load the new posts at the top, how to show every post in the right order without missing any post or duplicating any post?

Sorry for the bad explanation and the bad english.

  • 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-14T16:40:55+00:00Added an answer on June 14, 2026 at 4:40 pm

    You need to store the id of the last retrieved message. When you submit the new request, send the last received message id and have php/mysql return the results from there.


    If your query looks something like this:

    SELECT * FROM posts WHERE username='redcurley' LIMIT 10
    

    Then you’d need to modify to be something more like:

    SELECT * FROM posts WHERE username='redcurley' AND id > :id LIMIT 10
    

    You could alternatively use the offset method that Scott mentions.


    Edit: I assumed you were using auto-increment ids because it’s so common. Since you aren’t, you need some way to keep track of the last message returned. You can do this through sorting the records in a way that they’ll come out in the same order every time and use offsets.

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

Sidebar

Related Questions

I have an AJAX chat system that I'm working on and so far I
I have a report in our internal system that can return anywhere from 1
I'm trying to create a simple login system that will have the forms and
I have created a registration system that uses AJAX to process the form so
I have a system that involves an ajax post request that inserts a row
Trying to build a ajax comment system .I have a list populated from MYSQL
Hi I have a jQuery ajax request for a login system. At first, it
So I have a system using jQuery AJAX to load the content dynamically. I
I have ajax request that do 3 missions: Save Model (DB) Send Email Give
I have a series of dynamically generated inputs that I need to have ajax

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.