title: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous
body: <p>I am making a simple query but it is not working and I don't know why. I recently started becoming acquainted with PDO connections to databases.</p>
  
  <p>Here is the code : </p>
  
  <ol>
  <li><p>The Connections is : </p>
  
  <pre><code>define("HOST","localhost");
  define("USER","root");
  define("PASS","password");
  define("BASE","portugalforcedb");
  
  
  try{
      $conexao = 'mysql:host='.HOST.';dbname='.BASE;
      $connect = new PDO($conexao, USER, PASS);
      $connect-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  }catch(PDOException $erro){
      echo $erro-&gt;getMessage();
  }
  </code></pre></li>
  <li><p>then I create a a query that works like this : </p>
  
  <pre><code>try{
      $query = $connect-&gt;query("SELECT N.id,N.titulo,N.texto,N.autor,N.data,J.imagem_noticia FROM noticias N JOIN jogo J ON N.jogo_id = J.id WHERE N.publicada =1 ORDER BY N.data DESC LIMIT 4");
  }catch(PDOException $erro){
      echo $erro-&gt;getMessage();
  }
  
  while($dados = $query-&gt;fetch(PDO::FETCH_ASSOC))
  
  {
  </code></pre></li>
  </ol>
  
  <p>but then I create another query in another page like this that doesn't work : </p>
  
  <pre><code>$id = $_GET['id'];
      try{
      $query = $connect-&gt;prepare("SELECT N.id,N.titulo,N.texto,N.autor,N.data,J.imagem_noticia FROM noticias N JOIN jogo J ON N.jogo_id = J.id WHERE N.publicada =1 AND id=numero");
      $query-&gt;bindParam('numero',$id,PDO::PARAM_INT);
      $query-&gt;execute();
  }catch(PDOException $erro){
      echo $erro-&gt;getMessage();
  }
  
  $dados = $query-&gt;fetch(PDO::FETCH_ASSOC);
  </code></pre>
  
  <p>and I tried:</p>
  
  <pre><code>$id = $_GET['id'];
      try{
      $query = $connect-&gt;query("SELECT N.id,N.titulo,N.texto,N.autor,N.data,J.imagem_noticia FROM noticias N JOIN jogo J ON N.jogo_id = J.id WHERE N.publicada =1 AND id=numero");
  }catch(PDOException $erro){
      echo $erro-&gt;getMessage();
  }
  
  while($dados = $query-&gt;fetch(PDO::FETCH_ASSOC))
  </code></pre>
  
  <p>but then this error appears : </p>
  
  <blockquote>
    <p>SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous</p>
  </blockquote>