title: MySQL NOT LIKE query not working
body: <p>I have 2 tables:</p>
  
  <ul>
  <li>posts</li>
  <li>tags</li>
  </ul>
  
  <p>Tags table is structured like this:</p>
  
  <ul>
  <li>post_id</li>
  <li>tag</li>
  </ul>
  
  <p>So for every tag that's given for a post, I create a record in the tags table. If a post has 10 tags, there will be 10 records in tags table with that post_id.</p>
  
  <p>I'm now trying to build a search page where users can do a search for posts where tags do not contain the given keywords. This creates a problem though. A query like:</p>
  
  <pre><code>SELECT DISTINCT posts.id, posts.title, posts.content
     FROM jobs, tags
     WHERE tags.tag NOT LIKE '%$keywords%' AND posts.id=tags.post_id
  </code></pre>
  
  <p>doesn't work because if a post has got 6 tags and one of them has got the keyword, it will still be returned because the other 5 records in the tags table don't have that keyword.</p>
  
  <p>What's the best way to solve this? Any way other than creating a new column in the posts table which stores all the comma-separated tags used only for search??</p>