fdfdf
This commit is contained in:
@@ -26,13 +26,13 @@ final class Search
|
||||
foreach ($tokens as $tok) {
|
||||
$tok = trim($tok);
|
||||
if ($tok === '') continue;
|
||||
$conditions[] = "(title LIKE ? OR teaser_public LIKE ? OR description LIKE ? OR city LIKE ? OR region LIKE ? OR zip LIKE ?)";
|
||||
$bind[] = '%' . $tok . '%';
|
||||
$bind[] = '%' . $tok . '%';
|
||||
$bind[] = '%' . $tok . '%';
|
||||
$bind[] = '%' . $tok . '%';
|
||||
$bind[] = '%' . $tok . '%';
|
||||
$bind[] = '%' . $tok . '%';
|
||||
$conditions[] = "(title LIKE CONCAT('%', ?, '%') OR teaser_public LIKE CONCAT('%', ?, '%') OR description LIKE CONCAT('%', ?, '%') OR city LIKE CONCAT('%', ?, '%') OR region LIKE CONCAT('%', ?, '%') OR zip LIKE CONCAT('%', ?, '%'))";
|
||||
$bind[] = $tok;
|
||||
$bind[] = $tok;
|
||||
$bind[] = $tok;
|
||||
$bind[] = $tok;
|
||||
$bind[] = $tok;
|
||||
$bind[] = $tok;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -77,9 +77,8 @@ final class Search
|
||||
$sql .= " LIMIT {$limit}";
|
||||
|
||||
$stmt = $this->pdo->prepare($sql);
|
||||
|
||||
try {
|
||||
$stmt->execute();
|
||||
$stmt->execute($bind);
|
||||
return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
|
||||
} catch (\PDOException $e) {
|
||||
// Log into /debug/search_debug.log and continue with empty results
|
||||
|
||||
Reference in New Issue
Block a user