I want to use MySQL as some sort of timetable and I already built an SQL Table like this:
+------+--------+---------+-----------+----------+--------+
| TIME | MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY |
+------+--------+---------+-----------+----------+--------+
| 1 | NULL | NULL | NULL | NULL | NULL |
| 2 | NULL | NULL | NULL | NULL | NULL |
| 3 | NULL | NULL | NULL | NULL | NULL |
| 4 | NULL | NULL | NULL | NULL | NULL |
| 5 | NULL | NULL | NULL | NULL | NULL |
| 6 | NULL | NULL | NULL | NULL | NULL |
| 7 | NULL | NULL | NULL | NULL | NULL |
| 8 | NULL | NULL | NULL | NULL | NULL |
| 9 | NULL | NULL | NULL | NULL | NULL |
+------+--------+---------+-----------+----------+--------+
This is what I get when using SELECT. Now I want to insert data in a specific field.
I tried INSERT INTO timetable (MONDAY) WHERE TIME=1 but it didn't work, and after some Google research I got the information that it is not possible to use WHERE in combination with INSERT INTO.
Is there a way to insert data into a specific field or another way of using WHERE?
You can use UPDATE query for updated the selected row(s).
Query:
Here I insert sample data 'classes available' when time=1