Page 1 of 1

Knowledgebase

Posted: Mon Oct 26, 2009 9:15 pm
by MatthewNicoll
Hello everyone,
I am attempting to create a Knowledge base like this one,
https://www.hostingzoom.com/clients/ind ... ion1=kbase

I was wondering if someone who knows how this has been made could give me some tips on how to recreate it.
Even an idea of how difficult/complex something like this would be, would be great.

Thanks so much, look forward to your replies.

Re: Knowledgebase

Posted: Tue Oct 27, 2009 12:41 am
by MatthewNicoll
Any ideas? Is there another category I should post this in?

Re: Knowledgebase

Posted: Tue Oct 27, 2009 6:51 am
by Weiry
As far as PHP complexity goes, i cant see it being that overly difficult.

One problem you will need to overcome however is efficient database design.
And to keep your code clean, you will most likely want to make use of a variety of separate classes, so all your code is not kept entirely in a single file.

This way you could execute something like:

Code: Select all

 
$category = new Categories($databaseClass);
$faq = new FAQ($databaseClass);
 
$catName = $category->getCategoryName($_GET['cat']);
 
print "<Home link> : <a href='./?cat={$_GET['cat']}'>{$catName}</a>";
foreach($faq->getFaq($_GET['cat'],$_GET['faq']) as $row){
   print "{$row['faqTitle']}<br/>{$row['faqContent']}";
}
 
Which is an example of displaying a FAQ based on the category_id($_GET['cat']) and the faq_id ($_GET['faq'])


The best way to start designing something like this, is assess the information you wish to store, but also remember to keep it as simple as possible.
For instance,

Code: Select all

 
table `categories`
`id`, `name`
 
table `faq_contents`
`id`, `category_id`, `name`, `contents`
 
I hope that helps :)

Re: Knowledgebase

Posted: Tue Oct 27, 2009 7:13 pm
by MatthewNicoll
So the information will have to be stored in a mysql database?
I'm pretty new to php, but that definitely helped. Thank you so much.

Re: Knowledgebase

Posted: Wed Oct 28, 2009 1:00 am
by Weiry
MatthewNicoll wrote:So the information will have to be stored in a mysql database?
if you did not store the information in a database, you could have thousands of txt files being read causing major server load issues and just being overall inefficient.

PHP and MySQL sorta go hand in hand with each other, they make your life so much easier when you use both of them together :)