我有个问题!我真的不知道怎么解释,所以我来说明一下!
我知道如何在 SQL 上制作具有这种形状的表格:
var data = {
"news" :[
{
"title" : "I am the title 1",
"number of views" : 28,
"text" : "Here is the text",
"date of publication" : "13 March"
},
{
"title" : "I am the title 2",
"number of views" : 57,
"text" : "Here is the text",
"date of publication" : "24 May"
]
},
{
"title" : "I am the title 3",
"number of views" : 74,
"text" : "Here is the text",
"date of publication" : "27 May"
}
]
};
现在我希望能够创建一个具有这种形状的表格:
var data = {
"staff member" :[
{
"First name" : "John",
"Last name" : "Doe",
"schedules" : [
"Friday : 14h - 22h",
"Saturday : 10h - 19h",
"Sunday : 10h - 19h"
]
},
{
"First name" : "Amelia",
"Last name" : "Doe",
"schedules" : [
"Friday : 18h - 23h",
"Saturday : 9h - 17h",
"Sunday : 8h - 20h"
]
}
]
};
看到不同?对不起,如果它有点混乱,但我真的不知道该怎么称呼它!
我认为这可以通过创建另一个表并找到自己的名字、姓氏和时间表的通用 ID 来完成。但一定有更简单的方法,对吧?
所以我的问题很简单,这可能吗?如果是这样,如何?
我是用 JSON 做的,但现在我想切换到 MySQL,我不知道该怎么做!
aluckdog