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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:26:10+00:00 2026-06-16T01:26:10+00:00

I want to show my mysql data without refresh page, click button, change etc.

  • 0

I want to show my mysql data without refresh page, click button, change etc. If anyone one submit data on mysql from anywhere then I can see the his/her submitted data without refresh, change, click. data come from me automatically. I know jquery, ajax, php but I don’t find any way solving this problem. If you have any idea, please, share with me. Thanks

  • 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-16T01:26:11+00:00Added an answer on June 16, 2026 at 1:26 am

    So you know jQuery, AJAX and PHP, but you don’t know how to change data? At least try to be creative…

    First you need a PHP page that get’s the database data.

    header('Content-Type: application/json');
    
    require 'config.php';
    
    $json = array(
        'data'  => array()
    );
    
    $result = mysql_query('SELECT * FROM `my_table`');
    
    while($row = mysql_fetch_assoc($result)) {
        array_push($json['data'], $row);
    }
    
    echo json_encode($json);
    

    As you might notice, I like to transfer the data as JSON – hence the header() and json_encode() call.

    If you go to that page you’ll see the results from your database. Now you can call that file using jQuery AJAX. If you use an interval you can get the new data every x seconds.

    setInterval(fetchData, 10000); // get data every 10 seconds
    
    function fetchData() {
        $.getJSON('myfile.php', function(data, textStatus, xhr) {
            $.each(data.data, function(index, value) {
                // do something with every row
    
                console.log(value.id, value.content, value.date);
            });
        });
    }
    

    Voila!


    I can have huge discussions that programmers are creative. This is my point exactly. Knowing a language doesn’t make you a good developer. If it helps you, get a piece of paper and make a flow-graph or something.

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

Sidebar

Related Questions

I want to get data from table in MySQL and to show it in
I want to be able to separate the birthday from the mysql data into
I am trying to show information from database without reloading the page. I have
show columns from table_name; The above MYSQL command, displays all column names with data
I want to show the same data in a page where the data was
i want to get data from mysql db, first user select db, then enters
I have a table of data from mysql rendered on page via PHP into
I am trying to show the data coming from mysql database as a table
I have a table which show data from mysql database in HTML table like
I want show an information page after success db opartions. And after the info

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.