Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. //Verify table "a"
  2.  
  3. <?php
  4. $query_verifica = "SELECT rt.NOME as responsavel_tecnico, rt.RG responsavel_tecnico_RG, rt.CPF responsavel_tecnico_CPF, rt.CONSELHO_CLASSE as responsavel_tecnico_Conselho FROM responsavel_tecnico as rt WHERE CADASTRO_CADVISA = '$CADVISA'";
  5. $consultar = mysqli_query($conn, $query_verifica);
  6.  
  7. if($row=mysqli_num_rows($consultar) > 0){
  8.  
  9. //Update table "a" and "b"
  10.  
  11. $sqlresptec = "UPDATE responsavel_tecnico SET NOME = '$NOMEtec', RG = '$RGtec', CPF = '$CPFtec', CONSELHO_CLASSE = '$CONSELHO_CLASSE', WHERE CADASTRO_CADVISA = '$CADVISA'";
  12. mysqli_query($conn,$sqlresptec);
  13.  
  14. $sqlresplegal = "UPDATE responsavel_legal SET NOME = '$NOMElegal', RG = '$RGlegal', CPF = '$CPFlegal' WHERE CADASTRO_CADVISA = '$CADVISA'";
  15. $resplegal1 = mysqli_query($conn,$sqlresplegal);
  16.  
  17. }else{
  18. //Update just table "b"
  19. $sqlresplegal = "UPDATE responsavel_legal SET NOME = '$NOMElegal', RG = '$RGlegal', CPF = '$CPFlegal' WHERE CADASTRO_CADVISA = '$CADVISA'";
  20. $resplegal1 = mysqli_query($conn,$sqlresplegal);
  21. }
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement