Ajax调用数据库表

I have a database table called "mytable" with 1 column called col1. This column takes values 0 and 1 and it's updated every 15 minutes. I want a working example with a PHP page that will make an ajax call to this table and show image1 if value is 0 and image2 if value is 1.

This ajax called must be fired automatically every minute. Is it posisble?

thanks for the help

It is possible. More research would show you how but here is how you can do it;

First build a function that does an ajax call;

function call()
{
    return data; // Ajax here
}

then call it with an interval;

window.setInterval(function(){
  call();
}, 5000);

This will call it every 5 seconds. For the PHP part, you will need to do more research. You can simply create a page called Data.php and post to that page with jquery post or ajax then simply retrieve the data and parse it.