Kelvineger

exclui.php

Oct 7th, 2016
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. $link = mysqli_connect('localhost', 'root', '', 'pedeaqui');
  4.  
  5. if (!$link) {
  6.     die('Não foi possível conectar: ' . mysqli_error());
  7. }
  8.  
  9. $nome = $_POST['nNome'];
  10.  
  11. $query = "DELETE FROM classe WHERE nome = '$nome'";
  12.  
  13. $insere = mysqli_query($link, $query);
  14.  
  15. if($insere){
  16.     echo 'Excluido com sucesso';
  17. }else{
  18.     mysqli_error($link);
  19. }
Add Comment
Please, Sign In to add comment