Guest User

Untitled

a guest
Dec 19th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2. require('conexao.php');
  3.  
  4.  
  5.  
  6. $pdo = Database::conexao();
  7.  
  8. $stmt = $pdo->prepare('INSERT INTO cad_dependentes (identificacao, responsavel, adesao, total, nome, cpf, cargo, email, parentesco, valordependente) VALUES (:identificacao, :responsavel, :adesao, :total, :nome, :cpf, :cargo, :email, :parentesco, :valordependente)');
  9.  
  10. foreach ($_POST['usuarios'] as $usuario) {
  11. $usuario['identificacao']= $_POST['identificacao'];
  12. $usuario['responsavel']= $_POST['responsavel'];
  13. $usuario['adesao']= $_POST['adesao'];
  14. $usuario['total']= $_POST['total'];
  15. $stmt->execute($usuario);
  16.  
  17.  
  18. print($stmt->debugDumpParams());
  19.  
  20. echo '<pre>'; print_r($usuario);
  21.  
  22. }
  23.  
  24. //print_r($_POST);
  25. echo 'Cadastro realizado com sucesso<br><br>';
  26. //header('refresh:2;index.php');
  27.  
  28. ?>
Add Comment
Please, Sign In to add comment