prepare("SELECT * FROM daftar_akun_transaksi WHERE id = :id"); $stmt->bindParam(':id', $id, PDO::PARAM_INT); $stmt->execute(); // Fetch the data $data = $stmt->fetch(PDO::FETCH_ASSOC); if ($data) { // Return the data as JSON echo json_encode($data); } else { // If no data found, return an error message echo json_encode(['error' => 'Data not found']); } } else { // If no ID is provided, return an error message echo json_encode(['error' => 'Invalid ID']); } ?>