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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:08:38+00:00 2026-06-01T11:08:38+00:00

I currently have a MySQL database which I was hoping to use to store

  • 0

I currently have a MySQL database which I was hoping to use to store regularly updated data from a temperature sensor connected to the internet.

I currently have a page that, when opened, will grab the current temperature and the current timestamp and add it as an entry to the database, but I was looking for a way to do that without me refreshing the page every 5 seconds.

Detail:
The data comes from an Arduino Ethernet, posted to an IP address.
Currently, I’m using cURL to grab the data from the IP, add a timestamp and save it to the DB.
Obviously only updates when the page is refreshed (it uses PHP).

Here is a live feed of the data – http://wetdreams.org.uk/ChrisProject/UI/live_graph_two.html

TL;DR – Basically I need a middle man to grab the data from the IP and post it to a MySQL

Edit: Thanks for all the advice. There might be a little bit of confusion, I’m looking for a solution that (ideally) doesn’t require a computer to be on at all (other than the Server containing Database). Since I’m looking to store data over long periods of time (weeks), I’d like to set it up and leave a script running on the server (or Arduino) that gets the temp and posts it to the Database.

In my head I would like to have a page on the server that automatically (without any browser open, or any other prompting other than a timer) calls a PHP script.

Hope that clears things up!

  • 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-01T11:08:40+00:00Added an answer on June 1, 2026 at 11:08 am

    In this case, the best solution was using the Arduino to post a request to a PHP script which done its thing and added the retrieved value to a database. The way I have it running just now (for simplicity sake) is with a GET request from the Arduino using the EthernetClient.

    Code:

    char server[] = "www.example.com";
    

    and

    if(client.connect(server, 80)){
      client.println("GET /test.php?input_val=99 HTTP/1.0");
      client.println("HOST: www.example.com");
    }
    

    However, since I’d already built my website around the fact that the data was posted to an independent server/IP*, I opted to use cron to schedule a task. In this case I wanted to update my DB every 5 – 10 seconds. However, I’m piggybacking on somebody else’s server, so I contacted the server owner and asked them to set up a cron job calling “/mysubdir/cron_update.php” every minute (the fastest cron can call). From there I done a bit of ‘ScriptCeption’ and within the PHP script, completed my calls every 10 seconds for a minute before finishing the script.

    Thanks to everybody who helped me out, I’m posting this here as a complete answer and explanation, because technically everybody was correct.

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

Sidebar

Related Questions

I have a MySQL database which currently uses a tinyint field to store the
I have a column in a MySQL database which is currently all different lengths
I currently have a PHP file which will search my MySQL database and see
I currently have a very simple MySQL database (articlesDB) with 1 table (articles) and
I'm trying to normalize a mysql database.... I currently have a table that contains
I have a MYSQL database. Text is currently stored in charset latin1 , collation
Currently i'm writing a JDBC application to manage a MySQL database. I have the
I have a MySQL database called People which contains the following schema <id,name,foodchoice1,foodchoice2> .
I have a date field in a mysql database which I am trying to
I currently have 26 tables in a MYSQL database. My boss wants me to

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.