Advertisement
loki247

Untitled

Feb 3rd, 2017
2,705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "192.168.10.10";
  4. $username = "homestead";
  5. $password = "secret";
  6. $dbname = "ventapasajes";
  7.  
  8. // Create connection
  9. $conn = mysqli_connect($servername, $username, $password, $dbname);
  10. // Check connection
  11. if (!$conn) {
  12. die("Connection failed: " . mysqli_connect_error());
  13. }
  14.  
  15. $fecha = date('Y-m-d', strtotime($_GET["f"]));
  16. $horaSalida = $_GET["s"];
  17. $horaLlegada = $_GET["l"];
  18. $busId = $_GET["b"];
  19. $origenId = $_GET["o"];
  20. $destinoId = $_GET["d"];
  21. $valor = $_GET["v"];
  22.  
  23. $sql = "CALL registro_servicio('".$fecha."', '".$horaSalida."', '".$horaLlegada."', ".$busId.", ".$origenId.", ".$destinoId.", ".$valor.")";
  24. $result = mysqli_query($conn, $sql);
  25.  
  26. if (mysqli_query($conn, $sql)) {
  27. echo "<h1>Registro exitoso</h1>";
  28. } else {
  29. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  30. echo "<br> Fecha: ". $fecha;
  31. }
  32.  
  33. mysqli_close($conn);
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement