A
A
Anton none2017-02-11 23:08:27
MySQL
Anton none, 2017-02-11 23:08:27

How to convert JSON to MySQL?

There is JSON, even more complicated than this, several sublevels in the structure
I'm trying to figure out how to convert JSON into a table in muscle ...
already googled everything before contacting you ...
maybe there is some elegant way?

{
  "code":200,
  "err":"",
  "timestamp":1459855918,
  "data":{
    "city":[
      {
        "cityid":3877,
        "cityname":"",
        "districts":[
          {"id":1245, "name":"", "sort":0},
          {"id":1257,"name":"","sort":0},
          {"id":1461,"name":"","sort":0},
          {"id":1338,"name":"","sort":0}
        ]
      },
      {
        "cityid":2263,
        "cityname":"",
        "districts":[
          {"id":1223,"name":"","sort":0},
          {"id":1203,"name":"","sort":8},
          {"id":1048,"name":"","sort":8},
          {"id":1205,"name":"","sort":999}
        ]
      }
    ]  
  }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yaroslav Ivanov, 2017-02-12
@space2pacman

https://sqlizer.io/

A
Anton none, 2017-02-13
@AHTOLLlKA

any other ideas? can someone share the code in php?
many people have faced this problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question