This commit is contained in:
2026-01-02 00:53:58 +01:00
parent ad44b4eb9a
commit a856086ce1

View File

@@ -91,7 +91,20 @@ final class Search
echo $sql; echo $sql;
$stmt = $this->pdo->prepare($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) ?: []; return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
} }
} }