Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-Type: text/html; charset=UTF-8", true);
- require("connec.php");
- $cpf_agendamento = trim(filter_input(INPUT_POST, 'cpf_agendamento', FILTER_SANITIZE_STRING));
- $dtNascimento_agendamento = trim(filter_input(INPUT_POST, 'dtNascimento_agendamento', FILTER_SANITIZE_STRING));
- $sqlSelect = ' SELECT automovel_etapaUm_nome,automovel_etapaUm_sexo,automovel_etapaUm_dataNascimento,automovel_etapaUm_rg FROM cadastro_automovel ';
- $sqlSelect .= ' WHERE automovel_etapaUm_cpf ';
- $sqlSelect .= ' IN(SELECT cpf_agendamento FROM cadastro_agendamento WHERE cpf_agendamento = :cpf_agendamento) ';
- try{
- $qr = $conn->prepare($sqlSelect);
- $qr->bindValue(':cpf_agendamento',$cpf_agendamento,PDO::PARAM_STR);
- $qr->execute();
- if( count($qr) > 0 ){
- $dados = $qr->fetch(PDO::FETCH_LAZY);
- if($cpf_agendamento){
- echo $dados->automovel_etapaUm_nome;
- }
- if($dtNascimento_agendamento){
- echo $dados->automovel_etapaUm_dataNascimento;
- }
- }
- }catch(PDOException $e){
- echo $e->getMessage(); exit(0);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement