<?php
// array for JSON response
  $response= array();

    // include db connect class
   require_once __DIR__ . '/../DBConnect.php';

      $sql = "SELECT * FROM Vehicle1Group";
	  
	  
      $stmt = $conn->prepare($sql);
			$stmt->execute();
			$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
	if($result!=null &&  $result>0){
        $response["Vehicle1Group"] = array();
       
	foreach($result as $row) { 
			
          $Vehicle1Group["VehicleGroupID"] = $row["VehicleGroupID"];
          $Vehicle1Group["VehicleGroupName"] = $row["VehicleGroupName"];
         

          // push single product into final response array
          array_push($response["Vehicle1Group"], $Vehicle1Group);
        }
        // success
        $response["success"] = 1;
        // echoing JSON response
        echo json_encode($response);
      }else {
        // success
        $response["success"] = 0;
        $response["message"] = "No Data Availaible";
        // echoing JSON response
    		echo json_encode($response);
      }
?>
