diff --git a/src/Anonymizer.php b/src/Anonymizer.php index 306d72f..66739c9 100644 --- a/src/Anonymizer.php +++ b/src/Anonymizer.php @@ -41,10 +41,10 @@ public function anonymize(Connection $connection, array $targets) ->getSQL() ; $fetchRowsStmt = $connection->prepare($fetchRowsSQL); - $fetchRowsStmt->execute(); + $result = $fetchRowsStmt->execute(); // Anonymize all rows in current target table. - while ($row = $fetchRowsStmt->fetch()) { + while ($row = $result->fetch()) { $values = []; // Anonymize all target fields in current row. foreach ($targetTable->getTargetFields() as $targetField) {