Skip to content

Commit

Permalink
Resolução da issue #436
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielPintoSouza committed Jul 5, 2024
1 parent 1606b1f commit c343169
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dao/AlmoxarifeDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ public function listarTodos(){
")->fetchAll(PDO::FETCH_ASSOC);
return json_encode($almoxarife);
}catch (PDOException $e){
echo 'Error:' . $e->getMessage();
echo 'Erro ao listar almoxarifes: ' . $e->getMessage();
}
}

public function excluir($id){
try {
$pdo = Conexao::connect();
$pdo->exec("DELETE FROM almoxarife WHERE id_almoxarife=$id;");
$sql = "DELETE FROM almoxarife WHERE id_almoxarife=:id";
$stmt = $pdo->prepare($sql);
$stmt->bindParam(':id', $id);
$stmt->execute();
} catch (PDOException $e) {
echo 'Error:' . $e->getMessage();
echo 'Erro ao excluir almoxarife: ' . $e->getMessage();
}
}
}
Expand Down

0 comments on commit c343169

Please sign in to comment.