If you want to submit sensor data such as temperature to a remote server/database somewhere you need to use some kind of call to a web server since it isn't possible to connect directly to a database from the Arduino.
How do you post data to a JSON web service from an Arduino that's connected to the Internet?