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
Post a Comment