Knowledgebase

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MatthewNicoll
Forum Newbie
Posts: 4
Joined: Mon Oct 26, 2009 9:11 pm

Knowledgebase

Post 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.
MatthewNicoll
Forum Newbie
Posts: 4
Joined: Mon Oct 26, 2009 9:11 pm

Re: Knowledgebase

Post by MatthewNicoll »

Any ideas? Is there another category I should post this in?
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: Knowledgebase

Post 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 :)
MatthewNicoll
Forum Newbie
Posts: 4
Joined: Mon Oct 26, 2009 9:11 pm

Re: Knowledgebase

Post 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.
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: Knowledgebase

Post 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 :)
Post Reply