PDA

View Full Version : search engine


munaa80
11-24-2002, 08:53 AM
i have a table called news with a field called body which contains text posted by the poster, but the probles is that i want to search for a specific word ebtered by the user in the text stored in the body field, how can i do that?

regards

druffus
11-24-2002, 06:59 PM
Here ar some links to some information concerning it. Maybe it will lead you in the right direction. If you still have problems or a specific question you can reply to this post with it.

MySQL Manual - Answers to everything
http://www.mysql.com/doc/en/Fulltext_Search.html

DevShed Forums - The competition of here i guess, but they have more info on mysql searching in their forum.
http://forums.devshed.com/showthread.php?threadid=33497&highlight=searching

Thats a start. You may want to use a fulltext search or use a like search. Depends on what kind of results you are looking for out of your database. Fulltext has a nice ranking feature, so that if you send in a string it will rank your results based on how many of the words were found.

Hope that helps, please ask if ya need more help.

ConfusedOfLife
11-25-2002, 09:07 AM
Well, first of all it's a bad programming practice to name your html elements like body, html, script and other keywords.
As a second note, are you trying to make a query in a database or you just wana check out what the user entered in your html/php page? I suggest you to use js for the latter, since I love to mix PHP and JS and it gives you an incredible power and it's of course much faster!