3

What is the best way to store this kind of Javascript object to MySQL with the option to edit it's contents in the future? I've inserted some of the object array code below. The list contains multiple study programmes and subroups, the one in the example is "MIT" study programme and its subgroup is called "MIT 1-1", in the main file I have many more study programmes and also subgroups. Each of the subgroups contain lab works, lectures and exams arrays, all of which inside of them have different days of the week and each of the week days have assigned lectures/lab works/exams to them.

[
    {
      studyProgramme: "MIT",
      subgroup: "MIT 1-1",
      course: 1,
      labWorks: {
        monday: [
          {
            title: "Program Engineering",
            classroom: "502a.",
            start: "1995-12-17T15:00:00",
            end: "1995-12-17T15:45:00",
            type: "Lab Work"
          },
                    {
            title: "Information System Security",
            classroom: "118a.",
            start: "1995-12-17T16:15:00",
            end: "1995-12-17T18:00:00",
            type: "Lab Work"
          }
        ],
        tuesday: [],
        wednesday: [],
        thursday: [],
        friday: []
      },
      lectures: {
        monday: [
          {
            title: "Audiovisual Art",
            classroom: "228a.",
            start: "1995-12-17T13:00:00",
            end: "1995-12-17T14:30:00",
            type: "Lecture"
          }
        ],
        tuesday: [],
        wednesday: [],
        thursday: [],
        friday: []
      },
      exams : {
        monday: [
          {
            title: "Philosophy",
            classroom: "101a.",
            start: "1995-12-17T08:30:00",
            end: "1995-12-17T11:00:00",
            type: "Exam"
          }
        ],
        tuesday: [],
        wednesday: [],
        thursday: [],
        friday: []
      }
    }
  ]
Sau Lius
  • 63
  • 5

0 Answers0