diff --git a/src/App/Search.php b/src/App/Search.php index 60a9d27..ff8fd9c 100644 --- a/src/App/Search.php +++ b/src/App/Search.php @@ -91,7 +91,20 @@ final class Search echo $sql; $stmt = $this->pdo->prepare($sql); - $stmt->execute($bind); + foreach ($bind as $name => $value) { + $paramName = $name; + if ($name[0] !== ':') { + $paramName = ':' . $name; + } + $stmt->bindValue($paramName, $value, \PDO::PARAM_STR); + } + // Limit als INT binden + $stmt->bindValue(':lim', (int)$bind[':lim'] ?? (int)$bind['lim'] ?? (int)$limit, \PDO::PARAM_INT); + // Radius nur falls existiert + if ($distanceFiltering) { + $stmt->bindValue(':radius', $bind[':radius'] ?? $bind['radius'], \PDO::PARAM_STR); + } + $stmt->execute(); return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: []; } }