...

View Full Version : FAQ with Search



JDMallion
03-20-2007, 03:29 PM
Hi guys,

I am creating an FAQ for my site and I want people to be able to do a text search for specific FAQs containing that word or phrase and then to display the results of the search.

- What would be the best way of storing the FAQs considering I want to search them and also that I want to be able to have different section for the FAQs.

- Also what is the best way of implementing the search function?

Thank you for any help you can provide guys.

Joe :thumbsup:

aedrin
03-20-2007, 03:33 PM
1: In a database. Use a category table to store different 'sections'. Link them up with a foreign key.

2: Depends on your situation. If using MySQL, there's the fulltext capability (google 'mysql fulltext').

JDMallion
03-20-2007, 03:37 PM
Wicked, thank you aedrin, have not really used the advanced functions of Database's but am assuming a category table is relatively easy.

aedrin
03-20-2007, 03:41 PM
FAQ table:
id
question
answer
category_id

Category table:
id
name

List of all FAQs with their category, sorted by category:
SELECT faq.*, category.name FROM faq, category WHERE faq.category_id = category.id SORTY BY category.id ASC

JDMallion
03-20-2007, 03:43 PM
Brilliant Ty



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum