whats the best way to preform calculations on a page using data from a db? like if i had 3 numbers, wanted them sum'd and avg. is it best not to have the page do it but instead have the db do it in a query and update the table?
Best is a subjective term - if you are going to do this once a week, then any method that yeilds the correct value would work. However, if this calculation is going to be done by every visit to your page and by 1000's of visitors, then you need to determine the most cost effective solution. Another however, what if this calculation take a lot of time, you may want to "think out-side the box" and do the calculation elsewhere and just have the visitors retrieve the already calculated value (even if you have to calculate 100 such values, it may be better in the long run).
So The BEST solution is always related to the reasons behind it. Good luck! Einstein47 (How come we never see the headline, "Psychic Wins Lottery"?)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.