I want to convert the MySQL data using PHP in table called tbl_questions
to JSON and the result of JSON will be like this :
{
"allRoundData": [{
"name": "Animals",
"timeLimitInSeconds": 20,
"pointsAddedForCorrectAnswer": 10,
"questions": [{
"questionText": "Lions are carnivores: true or false?",
"answers": [{
"answerText": "True",
"isCorrect": true
}, {
"answerText": "False",
"isCorrect": false
}]
}, {
"questionText": "What do frogs eat?",
"answers": [{
"answerText": "Pizza",
"isCorrect": false
}, {
"answerText": "Flies",
"isCorrect": true
}]
}, {
"questionText": "Where do mice live?",
"answers": [{
"answerText": "In the sea",
"isCorrect": false
}, {
"answerText": "On the moon",
"isCorrect": false
}, {
"answerText": "On land",
"isCorrect": true
}, {
"answerText": "In a tree",
"isCorrect": false
}]
}]
}]
}
And how kind table I've to create to handle all these data ?