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.
19 lines
433 B
19 lines
433 B
<?php
|
|
|
|
require_once("../conn.php");
|
|
|
|
$model = $_GET['model'];
|
|
|
|
$sql_str = "SELECT id, model, price FROM facility_price WHERE model = :model ORDER BY id DESC";
|
|
$stmt = $conn->prepare($sql_str);
|
|
$stmt->bindParam(':model', $model);
|
|
$stmt->execute();
|
|
$el = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
if($el){
|
|
$price = $el['price'];
|
|
$id = $el['id'];
|
|
}else{
|
|
$price = null;
|
|
$id = null;
|
|
}
|
|
echo json_encode(['id'=>$id, 'price'=>$price]);
|