Hi all..

I have built a knowledge base, in html.. would just like to know how I can search for an answer using a search form, that I can have on the home page to find answers on the other html web pages., and just open that web page with the answers on it..

May not be possible. Which is why I came back to the php/mysql section for some PHP script,, if I were to add all my knowledge base answers to a Mysql, database..

So if I added a topics column in database KB, and inserted a whole bunch of random answers, how could I use php to have a simple form,, where I can type a word that may appear in any one of those answers, and all the possible answers can be listed... and when you click on an answer it copies it to clip board so it can be pasted in one swift motion..(I did this in the html version by the way, the click(copy to clipboard thing)..


Any help would be much appreciated, thanks for all your time.

Hi all..

I have built a knowledge base, in html.. would just like to know how I can search for an answer using a search form, that I can have on the home page to find answers on the other html web pages., and just open that web page with the answers on it..

Well, if your knowledge base is already completed in HTML, you can use htdig rather than putting everything into a mysql database. (www.htdig.org)

With PHP and a Database, you are able to search for answers by using a query like this:

SELECT * FROM KB WHERE answer LIKE '%SEARCHSTRING%'

If you want to search for more than one word, just repeat the last part and link with AND or OR:

SELECT * FROM KB WHERE answer LIKE '%SEARCHSTRING%' AND answer LIKE '%SEARCHSTRING_2%'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.