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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:39:10+00:00 2026-06-05T18:39:10+00:00

I need to make a moderate system like the one in fmylife.com. Basically the

  • 0

I need to make a moderate system like the one in fmylife.com. Basically the problem I have is loading the MySQL query using Ajax (without page refreshing) in to a div.
MySQL query

$sql = mysql_query(“SELECT * FROM posts WHERE active =’0’” LIMIT 1) or die (mysql_error());
$row = mysql_fetch_array($sql);

HTML

<div class=”post-body”><?php echo $row[‘sitepost’];?></div>

this data should be reloaded when pressing “yes” or “no” buttons. thanks in advance.

  • 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-05T18:39:11+00:00Added an answer on June 5, 2026 at 6:39 pm

    @mgraph is close but if you want to do this on a button click

    in post.php:

    //$UserOption will be Yes/No for button clicks or empty string for first load of the page
    
    $UserOption = $_REQUEST['UserClicked'];
    
    //Id will be set if a vote has been clicked or empty string if it's the first load
    $Id = $_REQUEST['Id'];
    
    //(Do something with $UserOption)
    
    $sql = mysql_query("SELECT * FROM posts WHERE active ='0' LIMIT 1") or die (mysql_error());
    $row = mysql_fetch_array($sql);
    echo $row['sitepost'];
    

    JS:

    <script type="text/javascript">
    $(document).ready(function(){
       update(null,null);
    })
    
    function update(Id, Vote) {
        $(".post-body").eq(0).load("post.php?UserClicked=" + Vote + "&Id=" + Id);
    }
    </script>
    

    HTML:

    <div class="post-body"></div>
    
    
    <button type="button" onclick="update(1, 'Yes');">Yes</button>
    <button type="button" onclick="update(1, 'No');">No</button>
    
    
    
    <button type="button" onclick="update(2, 'Yes');">Yes</button>
    <button type="button" onclick="update(2, 'No');">No</button>
    

    Alternate HTML/JS

    <script type="text/javascript">
    $(document).ready(function(){
        $("#yes").click(function(){
            update('Yes');
        })
        $("#no").click(function(){
            update('No');
        })
        update();
    })
    
    function update(Vote) {
        $(".post-body").eq(0).load("post.php?UserClicked=" + Vote);
    }
    </script>
    
    <div class="post-body"></div>
    <button id="yes" type="button">Yes</button>
    <button id="no" type="button">No</button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have problem with enum I need make a enum in base class or
i have one trouble, me need make scrollview with content of pdf(pages), this content
I need to make a administrative GUI with lots of functionality like lists, forms,
I need to make a series (1-20) ajax calls and I need to have
I need make a merge sort using an additional array. Here is my code:
I need make layout that must look exactly like below 2 sites. How should
I have some part of asynchronous code in my handlers, I need make this
Need to make a score board like UILabel. When the view is displayed to
there have two value, $a and $b . I need make a judge, $a
I am making a multi-table fulltext query.But I met some question. I need make

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.