'anniversary-decorations.php', 'aniversary-decoration' => 'anniversary-decorations.php', 'baby-decoration' => 'baby-decorations.php', 'baby-shower-decoration' => 'baby-shower-decorations.php', 'birthday-decoration' => 'birthday-decorations.php', 'cartoon-theme' => 'cartoon-theme-decorations.php', 'love-theme-decortation' => 'love-theme-decorations.php', 'premium-balloon' => 'premium-balloon-decorations.php', 'ring-setup' => 'ring-setup-decorations.php', 'ring-setup-decoration' => 'ring-setup-decorations.php', 'wedding-decoration' => 'wedding-decorations.php', 'welcome-baby-decoration' => 'welcome-baby-decorations.php' ]; $search_param = "%$search%"; $results = []; $max_results = 10; // Iterate over each table and search foreach ($tables as $table => $page) { $sql = "SELECT `name`, ? as page FROM `$table` WHERE `name` LIKE ?"; $stmt = $con->prepare($sql); if ($stmt) { $stmt->bind_param("ss", $page, $search_param); $stmt->execute(); $result = $stmt->get_result(); if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $results[] = $row; } } $stmt->close(); } } // Limit the total number of results to 10 $results = array_slice($results, 0, $max_results); if (!empty($results)) { echo '