SQL Database with GPY board
-
Hi,
I'm trying to figure out a way to use data in my sql database for my pycom project with the GPy board. Essentially, what I'm trying to do is run a select statement on my database and then pass the result of that statement to my code and do some logic.
Currently, I am using the urequests library and running a GET request on a firebase database to get some data for my program, but ultimately I will need to use a relational database and not a real-time database for my project.
Has anyone been able to get the results of a sql query and used it in the program or connected to a sql database? If so, can you pass along what you did or links to web pages to give me so help as to what I have to do? Anything is greatly appreciated, thank you.
-
Hi @jcaron,
Thank you for answering, so I reviewed that other forum as well before and I am still a bit confused. I understand creating a server side script in python, php, etc. to execute the SQL queries, however, I’m lost at how to return the results over HTTP.
I see the other forum talks about sending data to a MQTT broker, is that something I would have to do? Send the query results from the database to the broker and then subscribe to the MQTT?
-
@shanefowler25 see https://forum.pycom.io/topic/4509/connecting-wipy-3-0-with-a-mysql-database-using-upymysql/3
You probably want to have a server-side script which will make the SQL queries and return the data over HTTP (or vice-versa).