title: CakePHP: add variables to query in controller
body: <p>I have a controller action that uses a sql query:</p>
  
  <pre><code>    $tag = $this-&gt;params['tag'];
  
      $this-&gt;set('projects', $this-&gt;Project-&gt;query('SELECT * FROM projects INNER JOIN projects_tags ON projects.id = projects_tags.project_id INNER JOIN tags on projects_tags.tag_id = tags.id WHERE tags.tag LIKE $tag'));
  </code></pre>
  
  <p>As you can see at the end I want to use a where clause with the $tag variable but I'm not sure how the syntax would go. As I'm getting the error </p>
  
  <pre><code>Unknown column '$tag' in 'where clause'
  </code></pre>
  
  <p>Can someone steer me in the right direction? </p>
  
  <p>Ta,</p>
  
  <p>Jonesy</p>