Hi,
wouldn't return a count on the array just the number of records found ?
To get a total I'd suggest to add something like
$total = 0;
in front of the loop and inside the loop
$total += $dave;
(or $total += $dave*$valuenumber; if valuenumber stands for valuenumber times dave)
After the loop:
$total = number_format($total,2);
Or did I misunderstand something ?
Thomas