@Barand, your solution is very flexibility. Great idea. Thank you very much.
Can you kindly tell me how to process this HTML form and how to make INSERT query?
Do I need to change my database structure?
Thank you.
Yes I understand what you have said. Actually I am assuming opening hours is same for everyday. If I use different hours I may use different way to do this, but at this time I need to do this by assuming opening hours is same.
If its so, can you tell me how can I make the Insert query for this?
Thank you.
@Barand, Thank you for your info. Here I have attached an image to see you how I going to use these date in my website.
http://www.tiikoni.com/tis/view/?id=570f668
And this is how I get these info from users
http://www.tiikoni.com/tis/view/?id=3d00416
So, can you tell me what is the best way to this?
Thank you.
@Ch0cu3r, Thank you for your answer. But My question is I am getting two days from users, like Monday, Saturday with opening and closing time. So Now I need to insert into mysql all the records between this two days.
Eg:
Monday,9am,10pm
Tuesday,9am,10pm
Wednesday, 9am, 10am and until Saturday (To user secondly selected date)
I'm working on a website involving local restaurants, and one thing I need to do is store hours of operation. This is how I get operating hours from business owners.
// Sunday - Saturday 11AM - 6PM
$_POST['from'], $_POST['to'], $_POST['opening_time'], $_POST['closing_time']
Then I need to store these operating hours in `MySql` like below format.
- Sunday: 9am - 11pm
- Monday: 9am - 11pm
- Tuesday: 9am - 11pm
- Wednesday: 9am - 11pm
- Thursday: 9am - 11pm
- Friday: 9am - 11pm
- Saturday: 9am - 11pm
This is how my mysql table looks like.
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
)
I am not sure How to do this in php. so can anybody pointed my to right direction here? Any idea would be greatly appreciated. Thank you.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.