prepare($sql); $stmt->execute(); $data = $stmt->fetchAll(PDO::FETCH_ASSOC); if ($data) { // Print the car location data as JSON echo json_encode([ 'status' => 'success', 'data' => $data ]); } else { // Print a failure message jsonError($message = "No car locations found"); } ?>