ysadsad
This commit is contained in:
@@ -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) ?: [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user