changed return to bool on update and delete

This commit is contained in:
tracer 2022-10-28 17:01:08 +02:00
parent e2bf38299b
commit 56a3e584e7
1 changed files with 2 additions and 6 deletions

View File

@ -147,9 +147,7 @@ class AddressRepository
$statement->bindParam(param: 'zip', var: $zip);
$statement->bindParam(param: 'city', var: $city);
$statement->bindParam(param: 'phone', var: $phone);
$statement->execute();
return $statement->rowCount();
return $statement->execute();
} catch (PDOException $e) {
echo $e->getMessage();
return false;
@ -167,9 +165,7 @@ class AddressRepository
$statement = $this->databaseConnection->getConnection()->prepare(query: $sql);
$id = $addressBookEntry->getId();
$statement->bindParam(param: 'id', var: $id);
$statement->execute();
return $statement->rowCount();
return $statement->execute();
} catch (PDOException $e) {
exit($e->getMessage());
}