title: MySQL search query, sort result by best matches
body: <p>I'm working on a searchengine within a website where a visitor can provide some keywords and then the searchengine performs some queries over a datatable.</p>
  
  <p>I know how to query a table, but how can you build a single query which provides a full resultlist and per matching row in the datatable the number of occurences.</p>
  
  <p>So say, i have simple table like:</p>
  
  <pre><code>id | title | desc
  -----------------
  1  | title 1 | some text with some text provding the user most likely no interesting info.
  
  2 | title 2 | some other text
  
  3 | title 3 | some third text saying some other crap.
  </code></pre>
  
  <p>What i'm trying to achieve is: when a user searches for 'some text' i get a result like:</p>
  
  <pre><code>id | title | desc | noOfMatches
  -------------------------------
  1  | title 1 | ... | 4
  
  2  | title 3 | ... | 3
  
  3  | title 2 | ... | 2
  </code></pre>
  
  <p>Can someone help me with this one? I'm not sure how to create a query that can count the no. of occorences of a provided word in a query...</p>