eyaleyal Posted January 5, 2009 Share Posted January 5, 2009 Hello, I have articles in my website. Each article has title and content. I also have a search page to search my articles. So currently whenever someone is searching I use the following query (PHP + MySQL): ($keywords = the search keywords) SELECT * FROM articles WHERE title LIKE '%$keywords%' OR content LIKE '%$keywords%' My question is how do I show first in the list (ORDER BY) results that has the keywords in the title and only after that results that has the keywords in the content? Thanks! Quote Link to comment Share on other sites More sharing options...
fenway Posted January 5, 2009 Share Posted January 5, 2009 To get match rankings, you either need to use a full-text index (built-in or sphinx) or roll-your-own. 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.