944,181 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1549
  • PHP RSS
Jul 27th, 2006
0

Searching my web page

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jeadeb is offline Offline
11 posts
since Jul 2006
Jul 29th, 2006
0

Re: Searching my web page

Quote originally posted by jeadeb ...
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%'
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Rotak is offline Offline
19 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: listbox--issue php
Next Thread in PHP Forum Timeline: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC