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


$query = "                 SELECT COUNT(*) ans,mymonth, myyear,e.name ename , CONCAT(e.name,',', myyear) cname  FROM
                              ( 
                                   SELECT a.*,MONTH(a.date)mymonth, year(a.date) myyear   FROM  fvehicle a 
                              )d LEFT JOIN admonths e ON d.mymonth=e.monthid   
                              
                              GROUP BY mymonth, myyear
                               ORDER BY myyear,mymonth asc
                               
                    ";

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

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

print json_encode($data);

///MONTH(b.date)

