Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. $user = $_REQUEST['user'];
  3.  
  4. $host = "root";
  5. $db = "cadastro";
  6. $db_user = "root";
  7. $db_password = "root";
  8.  
  9. $con = new PDO("mysql:host=$host;dbname=$db", $db_user, $db_password);
  10.  
  11.  
  12. $stmt = $con->prepare("INSERT INTO users(nome,cpf,rg,endereco,email,senha,data_nascimento) VALUES (:nome,:cpf,:tg,:endereco,:email,:senha,:data_nascimento)");
  13. $stmt->bindParam(':nome',$user['nome_completo']);
  14. $stmt->binParam(':cpf',$user['cpf']);
  15. $stmt->binParam(':endereco',$user['endereco']);
  16. $stmt->binParam(':email',$user['email']);
  17. $stmt->binParam(':senha',$user['password']);
  18. $stmt->binParam(':data_nascimento',$user['data_nascimento']);
  19. $stmt->binParam(':rg',$user['rg']);
  20. $stmt->execute();
  21.  
  22. if($con){
  23. echo "Conectou!";
  24. }
  25. echo "Erro";
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement