+ 1

should i use a database table for that??

I'm creating a website for a school. it has three type of user 1. admin, 2. guardian, 3 teacher. im trying to implement a block system for the teacher. which will block teachers give attention results after a certain time. and the time will be changeable by the admin..my question should i create a table to store that time??or is their any other way to store that time??

1st Jan 2022, 11:15 AM
Ayan Poddar
Ayan Poddar - avatar
9 odpowiedzi
+ 1
Ayan Poddar First of all, I supposed you want a table with multiple teachers that had a different time value, but anyway, I still think you should store that separate time value in a table. I guess you probably want to store the time value in a text file, but since you are using a database for the rest of your project, then I think it's a bad idea to mix it with a text file. It would also be much easier for the admin to update the time value instead of messing with a text file.
1st Jan 2022, 7:09 PM
Jan
Jan - avatar
+ 1
i decided to store that time inside a table
4th Jan 2022, 3:27 AM
Ayan Poddar
Ayan Poddar - avatar
0
This depends on whether it's easy to extend and adapt to change in the future. You know, the database is a file too.
1st Jan 2022, 12:06 PM
FanYu
FanYu - avatar
0
I'm SQL so it's not that difficult. But is their any other option??
1st Jan 2022, 12:09 PM
Ayan Poddar
Ayan Poddar - avatar
0
I would say, you should create a table to store that time, and then you should create a relation to the table of teachers.
1st Jan 2022, 12:33 PM
Jan
Jan - avatar
0
but Quantum is it a really good approach to store a time in a database . because to store a value you need table. and store a single value in a table sounds silly im sorry if im wrong.. but is their any other way and what would be the professional way imean industrial way do it??
1st Jan 2022, 6:33 PM
Ayan Poddar
Ayan Poddar - avatar
0
Ayan Poddar I think you have to setup a database for this project. Some of the reasons for the database are that you can generate reports from the data. They might need additional functionality or features in future, having a db will allow you to easily add the additional features. If you need an option for which type of db to use, try Mysql (free) or Postgres SQL (Facebook use it). Try not to focus on the time issue, let's say you create a table called my table with a seed column (unique incremental Id), a time column, a user and a datestamp. You can then focus on the seed column to know which was first.
2nd Jan 2022, 9:30 PM
l4t3nc1
l4t3nc1 - avatar
0
but that concept of creating a table for a date is that really make sense??
3rd Jan 2022, 3:20 AM
Ayan Poddar
Ayan Poddar - avatar
0
Ayan Poddar That is my recommendation.
3rd Jan 2022, 9:11 PM
l4t3nc1
l4t3nc1 - avatar