<?php
$data = array();
require 'config.php';
$sql= "select sum(total) as total,sum(male) as male, sum(female) as female from mrcs";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$total = $stmt->rowCount();
if($total > 0){
while ($row = $stmt->fetchObject()) {
	$data['status'] = 'ok';
	$data['result'] = $row;
}
}
else{
        $data['status'] = 'err';
        $data['result'] = '';
    }
	//returns data as JSON format
    echo json_encode($data);
 ?>