Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    SQL Database with GPY board

    Scheduled Pinned Locked Moved Discussion
    sqldatabasegetgpygetting started
    3 Posts 2 Posters 335 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • shanefowler25S Offline
      shanefowler25
      last edited by

      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.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @shanefowler25
        last edited by

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

        shanefowler25S 1 Reply Last reply Reply Quote 0
        • shanefowler25S Offline
          shanefowler25 @jcaron
          last edited by

          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?

          1 Reply Last reply Reply Quote 0

          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
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom