Advertisement
csfeijo

Untitled

Apr 5th, 2021
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. if ( isset($_POST['nome']) && isset($_POST['sigla']) && isset($_POST['id_departamento'])) {
  2.         $id_departamento = $_POST['id_departamento'];
  3.         $nome = trim($_POST['nome']);
  4.         $sigla = trim($_POST['sigla']);        
  5.  
  6.         if ( strlen($nome) > 0 && strlen($sigla) > 0 ) {
  7.           $sql = $conn->prepare("UPDATE DEPARTAMENTOS SET
  8.                                    sigla = '$sigla',
  9.                                    nome = '$nome'
  10.                                  WHERE id_departamento = '$id_departamento'");
  11.           $sql->execute();
  12.         }
  13.  
  14.         header('location:listar-departamentos.php');
  15.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement