This commit is contained in:
2025-12-29 01:51:58 +01:00
parent f730c20082
commit b99239ca66

View File

@@ -8,16 +8,22 @@ $results = [];
if ($q !== '' && $pdo) {
$like = '%' . $q . '%';
$stmt = $pdo->prepare(
'SELECT id, title, teaser_public, description, city, region, starts_at, visibility, allow_kids, location_label
FROM events
WHERE starts_at >= NOW()
AND status != "cancelled"
AND (title LIKE :q OR teaser_public LIKE :q OR description LIKE :q OR city LIKE :q OR region LIKE :q OR zip LIKE :q)
ORDER BY starts_at ASC
LIMIT 100'
);
$stmt->execute(['q' => $like]);
$sql = 'SELECT id, title, teaser_public, description, city, region, starts_at, visibility, allow_kids, location_label
FROM events
WHERE starts_at >= NOW()
AND status != "cancelled"
AND (title LIKE :q1 OR teaser_public LIKE :q2 OR description LIKE :q3 OR city LIKE :q4 OR region LIKE :q5 OR zip LIKE :q6)
ORDER BY starts_at ASC
LIMIT 100';
$stmt = $pdo->prepare($sql);
$stmt->execute([
':q1' => $like,
':q2' => $like,
':q3' => $like,
':q4' => $like,
':q5' => $like,
':q6' => $like,
]);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: [];
}
?>