prepare(' SELECT t.* FROM `fmf_topics` AS t WHERE t.`topic_title` LIKE CONCAT("%", LOWER(:title), "%") '); $findTopics->bindValue('title', $query); $topics = $findTopics->execute() ? $findTopics->fetchAll(PDO::FETCH_ASSOC) : []; $findPosts = $pdo->prepare(' SELECT p.*, t.`topic_title`, u.`user_login` FROM `fmf_posts` AS p LEFT JOIN `fmf_topics` AS t ON t.`topic_id` = p.`topic_id` LEFT JOIN `fmf_users` AS u ON u.`user_id` = p.`user_id` WHERE p.`post_text` LIKE CONCAT("%", LOWER(:text), "%") AND p.`post_type` = 0 AND p.`post_deleted` IS NULL '); $findPosts->bindValue('text', $query); $posts = $findPosts->execute() ? $findPosts->fetchAll(PDO::FETCH_ASSOC) : []; } include FMF_LAYOUT . '/header.php'; ?>
Found %d topics and %d posts.', count($topics), count($posts)); echo '

Topics

'; foreach($topics as $topic) { ?>
Posts'; foreach($posts as $post) { ?> Re: by #