Query a web service every 1 minute

Asked

Viewed 591 times

6

I have a Web Service in JSON, which I am consulting through a PHP page and saving the data in a Mysql database. This Web Service contains information from some sensors and, every 1 minute wanted to make this query and save this data in the database. How I would do to make that timed consultation?

  • 3

    Tried a schedule with the cron ?

  • 1

    http://answall.com/questions/55251/ |http://answall.com/questions/121735/ | http://answall.com/questions/2818/

1 answer

-3

Good morning friend, Voce is using windows or linux ?

I did this using windows, which takes web service information through a PHP page and records hourly.

As I use windows as a server I did the following, I created a . BAT with the following code.

@ECHO OFF

:start

"C:\xampp\php\php.exe" -f "C:\xampp\htdocs\atualizaCadastro\Atualizar.php"

And I’ve programmed into windows tasks to run this bat every hour.

Now it’s just Voce adapt to use on a linux.

Obs: if you have any include on your page , the same has to contain all the way from c:....

Browser other questions tagged

You are not signed in. Login or sign up in order to post.