Skip to content
Snippets Groups Projects
Commit 613e4c2f authored by Peter Rotich's avatar Peter Rotich
Browse files

Order FAQ by question.

parent d5c45c7b
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,8 @@ $sql='SELECT faq.faq_id, question, count(attach.file_id) as attachments '
.' FROM '.FAQ_TABLE.' faq '
.' LEFT JOIN '.FAQ_ATTACHMENT_TABLE.' attach ON(attach.faq_id=faq.faq_id) '
.' WHERE faq.ispublished=1 AND faq.category_id='.db_input($category->getId())
.' GROUP BY faq.faq_id';
.' GROUP BY faq.faq_id '
.' ORDER BY question';
if(($res=db_query($sql)) && db_num_rows($res)) {
echo '
<h2>Frequently Asked Questions</h2>
......
......@@ -78,7 +78,7 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
)";
}
$sql.=' GROUP BY faq.faq_id';
$sql.=' GROUP BY faq.faq_id ORDER BY question';
echo "<div><strong>Search Results</strong></div><div class='clear'></div>";
if(($res=db_query($sql)) && ($num=db_num_rows($res))) {
echo '<div id="faq">'.$num.' FAQs matched your search criteria.
......
......@@ -76,7 +76,7 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
)";
}
$sql.=' GROUP BY faq.faq_id';
$sql.=' GROUP BY faq.faq_id ORDER BY question';
echo "<div><strong>Search Results</strong></div><div class='clear'></div>";
if(($res=db_query($sql)) && db_num_rows($res)) {
......
......@@ -33,7 +33,7 @@ $sql='SELECT faq.faq_id, question, ispublished, count(attach.file_id) as attachm
.' FROM '.FAQ_TABLE.' faq '
.' LEFT JOIN '.FAQ_ATTACHMENT_TABLE.' attach ON(attach.faq_id=faq.faq_id) '
.' WHERE faq.category_id='.db_input($category->getId())
.' GROUP BY faq.faq_id';
.' GROUP BY faq.faq_id ORDER BY question';
if(($res=db_query($sql)) && db_num_rows($res)) {
echo '<div id="faq">
<ol>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment