<?php
require_once("../dbconfig.php");
if(!empty($_POST["driver_id"])) {
$query ="SELECT * FROM vehicles WHERE driver_id=".$_POST["driver_id"];
//echo $query;
$res=$con->query($query);

$rows = array();
$row = mysqli_fetch_assoc($res);
echo json_encode($row);

//echo $row['id']."#".$row['make']."#".date("d/m/Y",strtotime($row['mot_date']))."#".date("d/m/Y",strtotime($row['insurance_date']))."#".$row['color']."#".$row['reg'];
}
  ?>