I got this code:
$totalcount = 0;
function print_results($results) {
foreach ($results as $id => $data) {
print_table($data);
}
}
function print_table($data) {
$totalcount = $totalcount + $data['gq_maxplayers'];
}
}
printf("</tr></tbody>");
}
But if I use it, $totalcount is being reset every time I try set it. While what I need to do is to add the last $totalcount result with the current one, so if it's on the first one is 25, and the other one is 24, in the end it should be 49.