GML MySQL table and data download

Discussion in 'Programming' started by Vallo92, Apr 17, 2019 at 7:54 PM.

  1. Vallo92

    Vallo92 Member

    Jun 20, 2016
    Hi everyone,
    I have a problem in the interaction between the data of a MySQL and GM table, and I would like to ask you experts for a solution.
    I am creating a game for mobile, and to make the data more important not editable by the player, I decided to save them and download them (when it is necessary) on a MySQL online database.
    I have a MySQL table containing a list of objects, and all its associated data. I'll give you a simple example:

    |  Obj  | Atk | Def | Element | Gold |
    | Sword |   5 |   5 | Fire    |   10 |
    | Bow   |   4 |   1 | Air     |    4 |
    | Axe   |   6 |   5 | Water   |   15 |
    Usually I have always used "http_get" to receive individual data, but in my case I need to download the entire table (which contains a lot of data), and save it in the game.
    Can you tell me how can I do?
    Having a look online I discovered the possibility of using json files (so print a json file via php and download it via GM), but I don't have a clear idea of how to use it. specifically I don't know how to properly organize a large amount of data to recreate on GM the exact same table as the previous MySQL database.

    I hope I could explain myself well, despite my bad English.

    Thank you!
  2. FrostyCat

    FrostyCat Member

    Jun 26, 2016
    See the example with Alice on this archived GMC post. If you had been using JSON properly, getting individual data is not too different from getting an aggregate.
    Vallo92 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