You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
517 B

<?php
require_once('../conn.php');
$person = $_GET['person'];
$floor = $_GET['floor'];
$sql_str = "SELECT id, price FROM demolition_price WHERE seat = :person AND floor = :floor AND status = 'Y' ORDER BY id DESC LIMIT 1";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':person', $person);
$stmt->bindParam(':floor', $floor);
$stmt->execute();
$demolish = $stmt->fetch(PDO::FETCH_ASSOC);
if($demolish){
echo json_encode(['price'=> $demolish['price'], 'id'=> $demolish['id']]);
}else{
echo false;
}