Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-20-2007, 03:29 PM   PM User | #1
JDMallion
New Coder

 
Join Date: Sep 2006
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
JDMallion is an unknown quantity at this point
Post FAQ with Search

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
JDMallion is offline   Reply With Quote
Old 03-20-2007, 03:33 PM   PM User | #2
aedrin
Senior Coder

 
Join Date: Jan 2007
Posts: 1,648
Thanks: 1
Thanked 58 Times in 54 Posts
aedrin will become famous soon enough
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').
aedrin is offline   Reply With Quote
Old 03-20-2007, 03:37 PM   PM User | #3
JDMallion
New Coder

 
Join Date: Sep 2006
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
JDMallion is an unknown quantity at this point
Wicked, thank you aedrin, have not really used the advanced functions of Database's but am assuming a category table is relatively easy.
JDMallion is offline   Reply With Quote
Old 03-20-2007, 03:41 PM   PM User | #4
aedrin
Senior Coder

 
Join Date: Jan 2007
Posts: 1,648
Thanks: 1
Thanked 58 Times in 54 Posts
aedrin will become famous soon enough
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
aedrin is offline   Reply With Quote
Old 03-20-2007, 03:43 PM   PM User | #5
JDMallion
New Coder

 
Join Date: Sep 2006
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
JDMallion is an unknown quantity at this point
Brilliant Ty
JDMallion is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:04 AM.


Advertisement
Log in to turn off these ads.