I've got a food menu which needs to have a pattern for when certain menus are displayed on a website.
For example, the pattern is split into yearly quarters, weeks and days.
**Quarter 1**
**Week 1**
Monday: 5
Tuesday: 4
Wednesday: 5
Thursday: 4
Friday: 6
Saturday: 7
Sunday: 7
The numbers represent the ID of the menu in the database.
So I have 4 quarters, 4 weeks and 7 days in the database. This is how it's laid out:
I don't get how to write the query to update the database, say for example I want to update the following:
I want to put Menu Number: 4, In Week 1, Quarter 1 on a Thursday? That is based off what they select on a HTML Checklistbox.
For your example the query could be something like this.
UPDATE menuset
SET thursday = 4
WHERE week = 1
AND quarter = 1
Something like this should work for you
update tablename SET monday=$monday WHERE week=$week AND quarter=$quarter