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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.