= CURDATE() AND driver_ride_scam.dateCreated < DATE_ADD(CURDATE(), INTERVAL 1 DAY) GROUP BY DATE(driver_ride_scam.dateCreated) ORDER BY date DESC"; try { $stmt = $con->prepare($sql); $stmt->bindParam(':driverID', $driverID); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); if (!empty($rows)) { // --- FIX IS HERE --- // Your Flutter app looks for d['message']. // We manually create the array with the key "message" to match your app. echo json_encode(array("status" => "success", "message" => $rows)); } else { jsonError("No ride scam record found"); } } catch (PDOException $e) { error_log("[get.php] " . $e->getMessage()); jsonError("An internal error occurred. Please try again later."); } ?>