Hi everybody. I want to implement a search function for my faq which consists of 1 answer for every question (this data is stored in a database)...
This is my thinking:
1. While doing the search I will grab every question and assign it to a string.
2. Then I would search that string (here I need some help).
3. If the keyword matches then I would output the question and answer to the user.(if there are say 20 answers how do I divide 5 answers for each page?)
Thanks!
FAQ search
Moderator: General Moderators
I found something really useful built in mysql its called full-text searching.
http://www.zend.com/zend/tut/tutorial-f ... c=0&view=1
http://www.zend.com/zend/tut/tutorial-f ... c=0&view=1
The tutorial is usefull if you have your questions and answers in a database (in separate tables). If you don' t have them like this or you don' t want to use a similar method (is better in my humble opinion than holding them in a single file ) you can use fopen and preq_match to search them if they are in a single file.