query("SELECT * FROM shs_records ORDER BY id DESC LIMIT 1"); $shs = $stmt->fetch(); echo json_encode($shs ?: ['error' => 'Нет данных']);