r/DatabaseHelp • u/insert-team-name • Mar 23 '15
Can you build a relational database using WAMP?
I have been given a project to design a food calculator, and the way i was think about setting the tables out is to build one that has all the meals and another that has all the ingredients and get it to reference that table when the user clicks the meal, so it will display all the ingredients and what they cost. Is this possible? or do I need to rethink?
Any help/tutorials would be appreciated.
2
Upvotes
View all comments
Show parent comment
1
u/BinaryRockStar May 15 '15
So you will need to do a loop in PHP and output an
<input type="checkbox" .../>element for each of the possible ingredients. The user can select whichever of the checkboxes they like to indicate which ingredients are included in the meal.The processing part of your script (if method == "POST") will then need to do another loop checking if each ingredient is selected and INSERT a row into the DB for each selected ingredient.