Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: Krist
- * Date: 08-Mar-18
- * Time: 12:18
- <?php
- /**
- * Created by PhpStorm.
- * User: patur
- * Date: 3/7/2018
- * Time: 8:57 PM
- */
- $servername = "localhost";
- $username = "root";
- $password = "123456789";
- $dbname = "havnarbio";
- $conn = new mysqli($servername, $username, $password, $dbname);
- $tempSeat ="";
- if (!empty($_POST["seats"])) {
- //Attempt to connect to MySQL database
- $seats = json_decode($_POST["seats"]);
- for($i = 0; $i < 80;$i++){
- $sql = "UPDATE ticket SET syning_ID=1, State=1 WHERE ID='$i'";
- if ($conn->query($sql) === TRUE) {
- echo "Record updated successfully";
- } else {
- echo "Error updating record: " . $conn->error;
- }
- }
- // Close statement
- $conn->close();
- } else {
- echo "Something went wrong";
- http_response_code(400);//Bad request
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement