hi, I'm in the process of building a PHP-based directory system for my local university listings businesses and their opening hours.
I could just have a text field to display the opening hours, i.e.But I wanted the page that listed the businesses to be dynamic and show a little icon next to the listing to show if it was open at that time.Monday: 9-5
Tuesday: 9-5
Wednesday: 9-5
Thursday: 8-5
Friday: 8-7
Saturday: 8-7
Sunday: Closed
The problem I have is that I don't know the best way to store this information in the database to achieve such results.
I figured I could have a table that looked something like this:with each field storing a number between 0 and 23 - but this seems quite inflexible, seeing as some businesses might open at 9:30 rather than 9, and some other businesses might close for lunch.Code:monday_open monday_close tuesday_open tuesday_close ....
So, yeah.... can anyone suggest a good system for me to store this information, to achieve the aim above?
Thank you![]()






Bookmarks