# 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:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HappyCookie](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/happycookie/32/3505_2.png) [@HappyCookie](https://community.particle.io/u/HappyCookie)\
**Post date:** [June 2, 2019, 4:29pm UTC](https://community.particle.io/t/reading-from-sql-database-get/50123/1 "2019-06-02T16:29:13Z")

</div>

Hello,

I would like to read data from a SQL database (strings) however I could not find a good example on the internet.

The project is a led matrix ticker where people can go to a website where they can update the displayed text. The website contains of a php script that puts data in a sql database.

Now I would like to let my photon (or wemos D1) to GET this data.

On the internet I only found these two “tutorials” but they do not work for me. It seems that both are for local use (?). There exists a lot of tutorials for writing so i’m doubting if it is even possible.  
ttp://ice786pk.com/?p=662  
[http://afterhoursengineering.net/blog/blog/2015/04/11/esp8266-read-and-write-data-to-a-database/](http://afterhoursengineering.net/blog/blog/2015/04/11/esp8266-read-and-write-data-to-a-database/)

I’m not that experienced with coding hardware. So If you could point me to a step by step guide that would be awesome! 🙂

Thank you in advance,  
Mark

 ![ticker1](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/7/7/770f05b9680668e142cdbcb8cbe9c67df9c4443d.jpeg) ![ticker2](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/8/4/84ce4bf6f434202c9bf4f7443a52376a6a69eb1c.jpeg)

---

<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.
