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/insert-team-name May 14 '15
Thanks for your help, i have done this and now have a working database that can assign 1 meal many ingredients, the problem i have come across is echoing it out so that the 2 ingredients are side by side. what happens is it creates the same meal twice each one having a separate ingredients. i think it's to do with the SQL statement:
$sql = "SELECT * FROM meal INNER JOIN mealingredients on mealingredients.MealID = meal.MealID INNER JOIN ingredients on ingredients.InID = mealingredients.InID";// GROUP BY ingredients.InName ";
or it might be where i'm echoing the code out: