I have an Admin chart which displays the activities of the users. One of the fields my client is asking for is a total number of securities purchased. Don’t worry what I’m talking about when I say securities purchased, sometimes I wonder what it really means. (ooooooo…)
The sum should come from the Database Table “users”. I want to be able to add all of the securities purchased (secpurch) together for a total. The only way I can think of it is like this:
[code=php]
if($id == 1) {
$secpurch1 = $row[‘secpurch’];
}
if($id == 2) {
$secpurch2 = $row[‘secpurch’];
}
//and so on…
$secpurchsum = $secpurch1 + $secpurch 2 + … ;
echo $secpurchsum;
Obviously this is not a very intelligent way of accomplishing this.
Does anyone have any better ideas?
Thanks You!