How to send data to data base with arduino

Hello everybody,

I would like to send data (temperature, humidity) to a data base create on 000webhost with Arduino and ethernet shield. I’m a newby at this stage !

Is it possible with this free hosting and if yes, let me know how to access to my data base (url, host) ?

I have create the data base and I can display the data on the website.
See : https://stridulous-plexigla.000webhostapp.com/

Thank you

You could use PHP and the host name is always localhost
If you required remote MySQL you could upgrade

Hello Infinity,

You mean that if I want to transfert data to my data base, I need to upgrade to Premium or Single hosting?

Thank you

Hi @fitness04,

You won’t necessarily need to upgrade to Hostinger if your database and website are both going to be hosted on the same platform. You’ll only need something like remote SQL when you plan to host your website and one server and the database on another.

To access your database, you can log in from the databases page in your control panel or you can use the link below that’ll take you right into PhpMyAdmin, when you log in with your database credentials.

https://databases.000webhost.com

Let us know if you have any more questions!

Hello Austin,

What I wanted to do is to send temperature and humidity data that are collected by an Arduino bord in my house to a remote data base hosted by 000webhost. And then, I want to display the data of the database to a web page hosted to the same web site.
It’s seem that it is not possible to send data with free hosting.
I have a sketch add.php that add data to the data base
To connect to this file I need to know :

  • The server adress
  • The host
  • the URL
    This an extraction of the arduino sketch to send data :
    message = (String("POST “) + url + " HTTP/1.1\r\n” +
    "Host: " + host + “\r\n” +
    “Connection: close\r\n” +
    “Content-Type: application/json; charset=utf-8\r\n” +
    "Content-Length: " + jData.length() + “\r\n” +
    “\r\n” + // This is the extra CR+LF pair to signify the start of a body
    jData + “\n”);
    Serial.print( "Message POST = ");
    Serial.println(message);

Thank you if you can help me

Many people use our free service and successfully store data in database using their Arduino device / Raspberry Pi etc.

I am not sure how to do that myself but I can only say I’ve seen working examples where people have easily set it up.

If you feel you are having issues with your account the easiest would be using the reset option, failing that delete and try a new website just incase anything was preventing the requests successfully working.

You can test your connection like so with PDO

Postman is also your best friend :slight_smile:

This topic was automatically closed after 2 days. New replies are no longer allowed.