GM:S 1.4 how to send and receive sql data

Discussion in 'Programming' started by royer14, Sep 9, 2019.

  1. royer14

    royer14 Member

    Joined:
    Dec 6, 2017
    Posts:
    23
    Hi, I have had this doubt for a long time and my goal is only to store, for example, game scores in a sql or mysql database. I have the following commands in sql.

    Code:
    1)   mysql.connector.connect(host="remotemysql.com", database="yvrcdG", user="yvdG",password="hdE7W",port=3306)
    
    2)  "UPDATE `tabla` SET `name`=........................................."
    
    3)   "INSERT INTO `tabla`(`name`, `Score`, `Comment`) VALUES ('Royer',5,'Interesting')"
    
    many say that I should use http_get and set but I don't understand very well how I can use it in this situation.
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,444
    You're getting advice from a bunch of amateurs at best if many of them think GET is appropriate for your situation. Requests that involve creating new resources should always be done over POST.

    The idea here is to create a web endpoint that accepts your request via HTTPS or HTTP, then proxies the database calls for you. Here is an old post from me with an example for how to retrieve and submit data this way.
     
    Greenwitch likes this.
  3. NightFrost

    NightFrost Member

    Joined:
    Jun 24, 2016
    Posts:
    1,921
    You may also want to consider changing some of your SQL connection details as you just posted them to a public forum for all to see.
     
  4. royer14

    royer14 Member

    Joined:
    Dec 6, 2017
    Posts:
    23
    excuse me, edit
    1) mysql.connector.connect(host="remotemysql.com", database="yvRswCrcdG", user="yvRswCrcdG",password="hRoTaydE7W",port=3306)

    2) "UPDATE `tabla1` SET `name`=........................................."

    3) "INSERT INTO `tabla`(`name`, `Score`, `Comment`) VALUES ('Royer',5,'Interesting')"
     
    BiTrunade likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice