php - How I store business hours in a mysql table -


i'm working on website involving local restaurants, , 1 thing need store restaurant operating hours in mysql.

data comes html php this.

// eg: monday saturday 8am 10pm $_post['from'], $_post['to'], $_post['opening_time'], $_post['closing_time'] 

my sql table structure this.

create table business_hours (   id integer not null primary key,   restaurant_id integer not null,   day integer not null,   open_time time,   close_time time ) 

my question getting 2 days users above opening , closing time. need insert business_hours table records between 2 days.

eg: monday, friday (if opening , closing period of week)

then need store these operating hours in table

monday,9am,11pm tuesday,9am,11pm wednesday,9am,11pm thursday,9am,11pm friday,9am,11pm 

can tell me how can this?

any idea appreciated.

thank you.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -