So if the first record returns a $total=3 and the second record returns a $total= 6, how do I keep track and add them together so the total revenue is accurate.? I'm going in circles.$SQL = "select * from datbase where (TO_DAYS(NOW())-TO_DAYS(dateadded) +<1)"; # look for records less than 1 day old &Do_SQL; while ($pointer = $sth->fetchrow_hashref) { $total = $pointer->{'total'}; if ($total eq "3") { $revenue = 30; } elsif ($total eq "6") { $revenue = 60; } elsif ($total eq "10") { $revenue = 100; } } $sth->finish();
In reply to Adding numbers from a loop by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |