This commit is contained in:
2025-12-31 01:20:10 +01:00
parent cbcd09003e
commit da08cf706e
2 changed files with 17 additions and 6 deletions

View File

@@ -87,12 +87,9 @@ final class Search
$sql .= " LIMIT :lim";
$stmt = $this->pdo->prepare($sql);
foreach ($params as $k => $v) {
$type = is_int($v) ? \PDO::PARAM_INT : \PDO::PARAM_STR;
$stmt->bindValue($k, $v, $type);
}
$stmt->bindValue(':lim', $limit, \PDO::PARAM_INT);
$stmt->execute();
$execParams = $params;
$execParams[':lim'] = $limit;
$stmt->execute($execParams);
return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
}
}