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