Advertisement
isabellevieirab

excluirprato

Nov 1st, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title></title>
  6. </head>
  7. <body>
  8. <?php
  9.     $host = "localhost";
  10.     $user = "root";
  11.     $pass = "";
  12.     $banco = "restaurante";
  13.     $conexao = mysqli_connect($host,$user,$pass,$banco) or die (mysqli_connect_error());
  14.  
  15.     $idprato = $_GET["id_prato"];
  16.  
  17.     $queryApagaPrato = "DELETE FROM pratos WHERE id_prato = '$idprato'";
  18.  
  19.     $apagarPrato = mysqli_query($conexao, $queryApagaPrato)or die("Algo deu errado ao excluir o prato. Tente novamente.");
  20.  
  21.     echo 'Prato excluido com sucesso!';
  22.  
  23. ?>
  24.  
  25.  
  26. <br><br>
  27. <a href="pratos.php">Voltar</a>
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement