<?php
require_once __DIR__ . '/../../connect.php';


// $promo_code = filterRequest("promo_code"); 
$driverID = filterRequest("driverID");

$sql = "SELECT * FROM `lisenceDetails`WHERE`driverID`='$driverID'";

$stmt = $con->prepare($sql);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);

if ($result) {
    // Print all promo records
    jsonSuccess($result);
} else {
    // Print a failure message
    jsonError($message = "Failed to retrieve promo records");
   
}
?>