PHPBuilder - Slapping together a search engine Page 3



RSS Twitter
Articles Tricks And Hacks

Slapping together a search engine - Page 3

by: Clay Johnson
|
July 30, 2000

Part 2: Searching the Table
Now you have an easy to-use table of keywords and their associations. How do you query this table? Here's what I do:
First I format each searchterms passed into the script as 'word1','word2','word3' and stick it in a string called $querywords.
Then I throw them into this SQL query:

SELECT count(search_table.word) as score, search_table.qid,your_table.blob
FROM search_table,your_table
WHERE your_table.qid = search_table.qid AND search_table.word
IN($querywords)
GROUP BY search_table.qid
ORDER BY score DESC";

« Previous Page
1
|
2
|
3
|
4
|
5
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Clay Johnson

Comment:



Comment:

(Maximum characters: 1200). You have characters left.