'ok', 'err' => ''); try { if (empty($_POST) || empty($_POST["fval"])) throw new \Exception("parameter empty"); foreach ($_POST as $k => $v) { $$k = htmlspecialchars(stripslashes(trim($v))); } list($floor, $seat) = explode(",", $fval); if (!$floor || !$seat) throw new \Exception("parameter empty[2]"); $db_query = "select id, price from demolition_price where release_date = '2021-11-10' and seat = '$seat' and floor = '$floor' and status = 'Y'"; $res = mysqli_query($link, $db_query); if ($row = mysqli_fetch_row($res)) { $rarr["id"] = $row[0]; $rarr["amt"] = $row[1]; } mysqli_free_result($res); }catch(\Exception $e) { $rarr['st'] = 'err'; $rarr['err'] = $e->getMessage(); } echo json_encode($rarr, JSON_UNESCAPED_UNICODE); exit; ?>