FAQ

Frequently Asked Questions

FAQ

Find answers to frequently asked questions about website hosting services.

set_charset('utf8mb4'); $sql = " SELECT kb.id, kb.title, kb.article FROM tblknowledgebaselinks kbl INNER JOIN tblknowledgebase kb ON kb.id = kbl.articleid WHERE kb.title LIKE CONCAT('%', ?, '%') OR kb.article LIKE CONCAT('%', ?, '%') GROUP BY kb.id, kb.title, kb.article LIMIT 100 "; $stmt = $con->prepare($sql); $stmt->bind_param("ss", $searchTerm, $searchTerm); $stmt->execute(); $res = $stmt->get_result(); while ($row = $res->fetch_assoc()) { $plain = strip_tags($row['article']); $snippet = function_exists('mb_substr') ? mb_substr($plain, 0, 250, 'UTF-8') : substr($plain, 0, 250); $searchResults[] = [ 'id' => (int)$row['id'], 'title' => $row['title'], 'slug' => slug($row['title']), 'snippet' => $snippet, ]; } $stmt->close(); $con->close(); } catch (Throwable $ex) { $db_error = 'Database connection or query failed.'; } } } ?>
🔍
Search Results
Couldn’t load search results due to a server issue.
0): ?>
= 250 ? '…' : '') ?>
No results found.
set_charset('utf8mb4'); // Detect an order column WHMCS might use $orderCols = ["weight","ordernum","sortorder","order","displayorder"]; $foundOrderCol = null; $inList = "'" . implode("','", $orderCols) . "'"; $sqlDetect = " SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tblknowledgebasecats' AND COLUMN_NAME IN ($inList) ORDER BY FIELD(COLUMN_NAME, $inList) LIMIT 1 "; if ($resDetect = $con->query($sqlDetect)) { if ($row = $resDetect->fetch_assoc()) { $foundOrderCol = $row['COLUMN_NAME']; } $resDetect->free(); } // Build ORDER BY to mirror WHMCS; fallback to id if no explicit order column $orderBy = $foundOrderCol ? "ORDER BY c.`$foundOrderCol` ASC, c.id ASC" : "ORDER BY c.id ASC"; // Categories with description and DISTINCT article counts $sqlCats = " SELECT c.id, c.name, c.description, COUNT(DISTINCT l.articleid) AS article_count FROM tblknowledgebasecats c LEFT JOIN tblknowledgebaselinks l ON l.categoryid = c.id GROUP BY c.id, c.name, c.description $orderBy "; $res = $con->query($sqlCats); while ($row = $res->fetch_assoc()) { $categories[] = [ 'id' => (int)$row['id'], 'name' => $row['name'], 'description' => $row['description'], 'count' => (int)$row['article_count'], ]; } $con->close(); } catch (Throwable $e) { $db_error = $db_error ?? 'Category load failed.'; } ?>

Save up to 75% on your plan + get a free domain

Try risk-free. 30-day money-back guarantee.