Files
Hamza-Ayed e68dda58d3 admin 20
2026-05-01 02:08:21 +03:00

23 lines
523 B
PHP

<?php
require_once __DIR__ . '/../../connect.php';
$country = filterRequest("country");
if (!empty($country)) {
$sql = "SELECT * FROM `kazan` WHERE `country` = :country";
$stmt = $con->prepare($sql);
$stmt->bindParam(':country', $country, PDO::PARAM_STR);
} else {
$sql = "SELECT * FROM `kazan` ORDER BY id DESC";
$stmt = $con->prepare($sql);
}
$stmt->execute();
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($row) {
jsonSuccess($row);
} else {
jsonSuccess([], "No Kazan record found");
}
?>