<?php
header("Content-Type: application/json");
include '../connection.php';

$sql = "SELECT userid, fname, lname, email, image FROM tblcred WHERE usertype = 2";
$result = mysqli_query($conn, $sql);

$deliverymen = [];

while($row = mysqli_fetch_assoc($result)) {
    $deliverymen[] = $row;
}

echo json_encode($deliverymen);
?>
