Forum Moderators: coopster
What i am trying to do is extract that data and generate a report.
i.e
i have 30 records total, but only 15 of them were entered by Agent "B"
i know how to pull the data and display it, but am not sure how i would count the entries to show the number "15"?
anyone got a tip?
function weekly_report() {
$security_admin = login::loginCheck('Admin', true);
$security_agent = login::loginCheck('Agent', true);
if ($security_admin === true ¦¦ $security_agent === true) {
$query = "SELECT associate, COUNT(associate) FROM registration_table GROUP BY associate";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$display .='There are '. $row['COUNT(nhm_associate)'] .' '. $row['nhm_associate'] . ' items.<br />';
}
} else {
// DISPLAY A WARNING TO THE PAGE AS ADMIN/AGENT IS NOT LOGGED
$display .= 'YOU ARE NOT AUTHORIZED TO VIEW THIS PAGE.';
}
return $display;
}