Sending data from Arduino + GSM shield to a MySQL database

Hey everyone,

I currently have an arduino that is connected to the internet through a gsm shield. The arduino has an ultrasonic sensor attached to it that will measure a distance every x minutes. The idea is to send the obtained distance value (using the gsm module) to a msql-database and store it there.

The sensor part is working fine but i have no experience with SQL or PHP so im stuck on this, I was wondering if someone could give some advice on where to start.

So my question is how do i set up this database correcly and how do i make sure that the value is sent and stored in this database

Thanks in advance

No need for PHP, just connect directly to your database with the MySQL connector library. Much easier.

That would save a lot of trouble indeed, i'll see if i can get it to work. Thanks :)

wvmarle: No need for PHP, just connect directly to your database with the MySQL connector library. Much easier.

This library only seems to work well with Ethernet or wifi shields, not a gsm shield, so i dont think this would be the solution

It's not a good idea to have your MySQL server open for remote connections anyway. If you have a MySQL server, you also have access to PHP (or whatever server side scripting language you wish to use). Use it, let it do the heavy lifting instead of the Arduino.

Here's what I use (Arduino + PHP code), it's for an ESP8266, but the HTTP etc. is all the same. HTTP-POST-char-array

Using MySQL with PHP is really easy: PDO Tutorial for MySQL Developers

Pieter