MySQL is an ideal way to store hours information

I want to keep a standardized set of information about when a business is open for every day of the week. Is there a standard way to easily store / modify this in MySQL?

Thank!

+3
source share
2 answers

Database design is truly an art; there are many different ways to design circuits.

I would start with a table, say "business_hours", and make the following columns:

- business_id (integer, auto increment) 
- business_name (varchar, largish like 255)
- open_monday   (varchar, integer, however you want to represent the data.)
- close_monday

Repeat the pattern of the last two columns until Sunday.

This is one way to do this, it is not a very difficult way, but it will work. Because I do not fully understand your context (that is, who uses it, who looks at it), it may be turned off a bit.

+4
source

, html. , , , sql . , , , , , , , . , SamT , .

0

All Articles