Advertisement
Guest User

Untitled

a guest
Mar 8th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Krist
  5. * Date: 08-Mar-18
  6. * Time: 12:18
  7. <?php
  8. /**
  9. * Created by PhpStorm.
  10. * User: patur
  11. * Date: 3/7/2018
  12. * Time: 8:57 PM
  13. */
  14.  
  15. $servername = "localhost";
  16. $username = "root";
  17. $password = "123456789";
  18. $dbname = "havnarbio";
  19.  
  20. $conn = new mysqli($servername, $username, $password, $dbname);
  21. $tempSeat ="";
  22. if (!empty($_POST["seats"])) {
  23. //Attempt to connect to MySQL database
  24.  
  25. $seats = json_decode($_POST["seats"]);
  26. for($i = 0; $i < 80;$i++){
  27. $sql = "UPDATE ticket SET syning_ID=1, State=1 WHERE ID='$i'";
  28.  
  29. if ($conn->query($sql) === TRUE) {
  30. echo "Record updated successfully";
  31. } else {
  32. echo "Error updating record: " . $conn->error;
  33. }
  34. }
  35.  
  36. // Close statement
  37. $conn->close();
  38. } else {
  39. echo "Something went wrong";
  40. http_response_code(400);//Bad request
  41.  
  42. }
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement