我想在名为tbl_questions
的表中使用PHP将MySQL数据转换为JSON,JSON的结果将如下所示:
{
"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
}]
}]
}]
}
我要创建哪种表来处理所有这些数据?