How to convert MySQL data to JSON nested array using PHP -


i want convert mysql data using php in table called tbl_questions json , result of json :

{ "allrounddata": [{     "name": "animals",     "timelimitinseconds": 20,     "pointsaddedforcorrectanswer": 10,     "questions": [{         "questiontext": "lions carnivores: true or false?",         "answers": [{             "answertext": "true",             "iscorrect": true         }, {             "answertext": "false",             "iscorrect": false         }]     }, {         "questiontext": "what frogs eat?",         "answers": [{             "answertext": "pizza",             "iscorrect": false         }, {             "answertext": "flies",             "iscorrect": true         }]     }, {         "questiontext": "where mice live?",         "answers": [{             "answertext": "in sea",             "iscorrect": false         }, {             "answertext": "on moon",             "iscorrect": false         }, {             "answertext": "on land",             "iscorrect": true         }, {             "answertext": "in tree",             "iscorrect": false         }]     }] }] 

}

and how kind table i've create handle these data ?


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -