Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', true);
- error_reporting(E_ALL);
- include_once("conPDO.php");
- $pdo = conectar();
- $data = file_get_contents("php://input");
- $data = json_decode($data);
- $nome = $data->nome;
- $email = $data->email;
- $senha = $data->senha;
- $idCep = $data->idCep;
- $tipoUsuario = "C";
- $verificaUsuario=$pdo->prepare("SELECT * FROM usuarios WHERE nome=:nome AND email=:email");
- $verificaUsuario->bindValue("nome", $nome);
- $verificaUsuario->bindValue("email", $email);
- $verificaUsuario->execute();
- $quant = $verificaUsuario->rowCount();
- if($quant != 1){
- $insereUsuario=$pdo->prepare("INSERT INTO usuarios (idUsuario, idCep, tipoUsuario, nome, email, senha) VALUES (?, ?, ?, ?, ?, ?)");
- $insereUsuario->bindValue(1, NULL);
- $insereUsuario->bindValue(2, $idCep);
- $insereUsuario->bindValue(3, $tipoUsuario);
- $insereUsuario->bindValue(4, $nome);
- $insereUsuario->bindValue(5, $email);
- $insereUsuario->bindValue(6, $senha);
- $insereUsuario->execute();
- }else{
- O que colocar aqui?
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement