I'm looping through a list of client names to get their total minutes used for a service. The problem is, each client has more than one database so I have to loop through those too, and then add the totals associated with each client. I'm not able to add the results for each client. What am I doing wrong?
PHP
foreach ($clients as $client) {
foreach ($dbNew as $d) {
$result += (strtotime($closing_time[$x]->log_time) - strtotime($opening_time[$x]->log_time));
print "<pre>";
print_r($client);
print " --- ";
print_r($result);
print "</pre>";
}
}
Output
adarty@cfl_rr.com --- 425
adarty@cfl_rr.com --- 225
doug --- 0
doug --- 0
rforgo@gmail.com --- 0
rforgo@gmail.com --- 4357
rforgo@gmail.com --- 336
PHP to get client totals (feeble attempt):
$client_result = 0;
if($client == $client)
$client_result = $result + $result;
The results from this are incorrect.