Guest User

Untitled

a guest
Feb 1st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. $servername = "xxx.xxx.x.xx";
  3. $username = "xxxxx";
  4. $password = "xxxxxxx";
  5. $dbname = "xxxxxxx";
  6.  
  7. $conn = new mysqli($servername, $username, $password, $dbname);
  8. $conn->set_charset('utf8');
  9.  
  10. $data = $_POST['DataEntrada'];
  11. $utente = $_POST['Utente'];
  12. $observacao = $_POST['Observacao'];
  13. $estado = $_POST['Estado'];
  14. $colaborador = $_POST['Colaborador']
  15.  
  16. $sql = "INSERT INTO regOratorio (`DataEntrada`,`Utente`,`Observacao`,'Colaborador')
  17. VALUES ('$data','$utente','$observacao','$colaborador')";
  18.  
  19. if ($conn->query($sql) === TRUE) {
  20. $last_id = $conn->insert_id;
  21. }
  22.  
  23. $sql1 = "INSERT INTO EstadoOratorio (`IdOrat`,`Estado`)
  24. VALUES ('$last_id','$estado')";
  25.  
  26. if ($conn->query($sql1) === TRUE);
  27.  
  28. $rowCount = $query->num_rows;
  29.  
  30. $conn->close();
  31. ?>
Add Comment
Please, Sign In to add comment