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.
-
@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).
-
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?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login