<?php   include_once('../config/db.php');   include_once('../config/check.php');
             
  


$query = "             SELECT COUNT(*) ans,a.stafftype,b.name dname  FROM fstaff a

                         LEFT JOIN fstafftype b ON a.stafftype=b.id
                         group BY stafftype 
                               
                    ";

$result = $conn->query($query);

		    foreach ($result as $row) {
		                                $data[] = $row;
		                             }

print json_encode($data);

///MONTH(b.date)

