# Reading from SQL database (GET)

**URL:** <https://community.particle.io/t/reading-from-sql-database-get/50123>\
**Category:** Getting Started\
**Created:** [June 2, 2019, 4:29pm UTC](https://community.particle.io/t/reading-from-sql-database-get/50123 "2019-06-02T16:29:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 2, 2019, 6:20pm UTC](https://community.particle.io/t/reading-from-sql-database-get/50123/2 "2019-06-02T18:20:49Z")

</div>

You'd need a server/service running on your SQL host which listens on a port to which you send the GET request which then collects the data from your DB an returns the data via the HTTP response.  
If you want to do that in a secure fashion you'd want to do that via a webhook.

This thread may be a bit old and uses some outdated syntax, but it might provide some pointers

> [@Get variables from a MySQL database](https://community.particle.io/t/get-variables-from-a-mysql-database/7661/7):
>
> I know how to get variables from MySQL database to a PHP page, what I don’t know is how to take them from the PHP page and use them in the Spark.

---

_[View the full topic](https://community.particle.io/t/reading-from-sql-database-get/50123)._
