hhhhhhh Posted November 19, 2005 Share Posted November 19, 2005 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! Quote Link to comment Share on other sites More sharing options...
bljepp69 Posted November 19, 2005 Share Posted November 19, 2005 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. Quote Link to comment Share on other sites More sharing options...
ryanlwh Posted November 19, 2005 Share Posted November 19, 2005 if you want to do it with LIKE, put % around the keyword LIKE '%$keyword%' Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.