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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:44:15+00:00 2026-05-26T01:44:15+00:00

I have a page (index.php) that pulls posts from mysql database. The posts are

  • 0

I have a page (index.php) that pulls posts from mysql database. The posts are paginated, limited to 5 per page. Each post has a radio button pair (like/dislike). The index page also allows the user to show or hide all liked/disliked posts through checkboxes.

I don’t want to reload the page at all, ajax or not. What I want is the next post in line to appear at the bottom of the list as posts already there are hidden.

Let’s say each page has 5 posts (l=liked/d=disliked/NA = not decided):
Page 1: Post 1 (l), Post 2 (d), Post 3 (d), Post 4 (l), Post 5 (d)
Page 2: Post 6 (NA), Post 7 (NA), Post 8 (l), Post 9 (NA), Post 10 (NA)

If the user decides to Hide all disliked – all disliked posts will hide but the result I get right now is:
Page 1: Post 1 (l), Post 4 (l)
Page 2: Post 6 (NA), Post 7 (NA), Post 8 (l), Post 9 (NA), Post 10 (NA)

What I want is:
Page 1: Post 1 (l), Post 4 (l), Post 6 (NA), Post 7 (NA), Post 8 (l)
Page 2: Post 9 (NA), Post 10 (NA)

Furthermore, the NEW posts appearing on Page 1 ought to fade in while the OLD posts (1 & 4) should have no such effect (other than slide up because the divs between them have “disappeared”).

What I want to know for now is, Is this possible to do? If so, where can I go to get started?

I’ll be updating with code as I learn more but for now I just need someone to point me in the right direction as google isn’t helping me in this regard.

  • 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-05-26T01:44:15+00:00Added an answer on May 26, 2026 at 1:44 am

    The dead-simple way to do this would be to send out an AJAX call every time the user changes their filter settings. Do the filtering in your MySQL query, and return the complete list of posts than should be showing. Then it’s just a matter of completely replacing the current posts with the new ones.

    There are ways to improve on this, like keeping previously-seen posts around but hidden to reduce the number of DB calls you’ll need, but I’d definitely not bother with that if you’re just starting the page. Even when you’re closer to done I don’t know if I’d bother – it’s a lot of fairly complex code for a relatively minor optimization.

    Hope this helps!

    Edit: Some example SQL – this particular example will give you the first page of posts that are liked, assuming you display 10 posts per page:

    SELECT * FROM posts WHERE liked = 1 LIMIT 10
    

    Just tweak the WHERE clause for different filters, and the LIMIT clause for different numbers of posts per page (You’ll probably need a JOIN in there too, if likes are on a per-user basis, but I didn’t include that).

    Then you replace all of the posts that are currently showing with all of the selected posts, using jQuery / AJAX.

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

Sidebar

Related Questions

I have a page, index.php, that shows information based on a mysql db. There
I have a function that I use on index.php page and I would like
I have a first.js file included in the page index.php that have something like
I have the following page: mysite.com/news/index.php?tag=tag&name=name&id=id I want to rewrite this so that it
I have a rewrite rule that works for my index page RewriteRule ^index$ index.php
Usually I have the main page (index.php) that include header/footer/menu and the content of
I have a PHP script (index.php) that changes the page shown depending on the
I have a page index.php where i have a link called add_users.php. In add_users.php,
I have an index page index.php , and when the user clicks on a
I have the following scenario. I have a index.php page with the following JQuery

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.