I am trying to find the sum total of all the values inserted by daily entry in database for many clients.
There can be many clients and each client should have their own total for a particular month. Please help… :-X
I see the problem there is no code to look at.
Here is the code:
$res4=“SELECT client_name, da_amt, da_rate, da_val, da_plan, da_comm
FROM client_entry
INNER JOIN agent_comm ON client_entry.client_no = agent_comm.client_no
WHERE client_entry.agent_no =’”.$agent_no."’
AND MONTH( da_date ) =".$month."
AND YEAR( da_date ) =".$year."";
$select_query4=mysql_query($res4) or die(“cannot connect execute query” + mysql_error());
while($row4 = mysql_fetch_array($select_query4))
{
echo “
echo ‘
echo ‘
echo ‘
echo ‘
echo ‘
$datotal=$datotal + $row4[‘da_comm’];
echo ‘
echo “
}
so it basically will output the daily collection of a particular agent. But it displays the whole entries present in the month whereas i just want to show a single entry summing up the “da_val” of a client and displaying it in “da_amt”…
output it give -
da_name | da_val | da_amt | da_plan | da_rate | da_comm
x | 100 | 100 | A | 10 | 10 (for date a/b/c)
x | 100 | 100 | A | 10 | 10 (for date x/b/c)
I need -
x | 100 | 200 | A | 10 | 20
ANYONE HELP…???