I have an equation that I need to process from a couple MySQL columns. I am just trying to figure out the best way of doing this once I run my SELECT statement to retrieve all the data.
Table - tbl_Spirits
Columns - ID, Volume, Proof
I know how to retrieve all the Data from MySQL, the problem is, is that there may be one record returned or 5. Probably never more then 5. Is there a clean fast method of the equation below in PHP.
This example is if there was 2 records returned.
((Volume1 * Proof1) + (Volume2 * Proof2)) / (Volume1 + Volume2)