<?php
include "../../connect.php";
$driverID = filterRequest("driverID");
$passendgerID = filterRequest("passendgerID");

$sql = "SELECT
    `id`,
    `driverID`,
    `passendgerID`,
    `rideID`,
    `tipAmount`
FROM
    `tips`
WHERE
    `driverID`='$driverID'OR`passendgerID`='$passendgerID'";
$stmt = $con->prepare($sql);
$stmt->execute();

if ($stmt->rowCount() > 0) {
    // Fetch the record
    $row = $stmt->fetchAll(PDO::FETCH_ASSOC);
    $count = $stmt->rowCount();
    
    
    printSuccess( $row);
    
}
    else{
    // Print a failure message
    printFailure($message = "No wallet record found");
}
?>