Hello dear Dp members. I'm trying to make a scheduling script using PHP and MySQL. Each schedule has 144 different fields in it. I'm trying to find an easy way to add records to the MySQL table by simplifying the tables. I don't think it's a good idea to have 144 different columns. Please advise. To give you a better understanding of how the schedule should like I added an image of the schedule to this post. Thank you in advance for your help.
There's no real reason to have the days and such in the database. Just make a table for employees, one for dates/shifts and a table for storing who works when (in this table you store one record for each employee/day, with date, shift number etc)
That sounds like an excellent idea. I still need to think about how to set up the MySql database any input will be appreciated. Thank you so much
Here is how I would construct the tables: employees-> id (primary/auto increment) name shifts-> id (primary/auto increment) name employee_shifts-> employee_id (primary) shift_id (primary) date (primary) Code (markup): This will allow you to control and add more shifts if needed.