Jump to content

searching variants for a keyword


hhhhhhh

Recommended Posts

I'm trying to buid up a search engine to my web site, and when I hid the search button for example for "computer" it only shows me results for pages which includes only the word computer.

 

but it would be ok if I would get a results as well for "computers" which has just a little "s" added to this string

 

 

 

this is my query

 

SELECT p.page_url AS url,

COUNT(*) AS occurrences

FROM r_page p, r_word w, r_occurrence o

WHERE p.page_id = o.page_id AND

w.word_id = o.word_id AND

w.word_word = \"$keyword\" ->> and here is the keyword

GROUP BY p.page_id

ORDER BY occurrences DESC

 

how can I do IT? i;ve tried with

 

w.word_word LIKE \"$keyword\" and won;t work

 

thanks guys!

Link to comment
https://forums.phpfreaks.com/topic/2895-searching-variants-for-a-keyword/
Share on other sites

You may want to check out this excellent tutorial on [a href=\"http://www.phpfreaks.com/tutorials/129/0.php\" target=\"_blank\"]MySQL Full-Text Searching with PHP[/a]. Your query will be set up differently, but you are likely to get back better results.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.