Hey everyone, I have a bit of trouble with one of my courseworks!
I need to calculate the amount of protein, carbs and fat within a type of food. The amount of these are given per 100 grams, and are stored in the food table.
There is another table called Meals, where I have to set an amount of the food to eat, this is also in grams. With these tables I need to get the value of protein, carbs and fat depending on the amount of food they said they wanted.To do this I think i need to divide every value in the row by 100 and then times by the amount the user set.
Does anyone know how I could do this division, and if it is the correct way to be doing it?
[url]http://img220.imageshack.us/img220/3867/helpmysql.png[/url]
Sorry, you need to Log In to post a reply to this thread.