title: Tracking an SQL mistake
body: <p>I am having the following problem:
  i'm using this piece of code</p>
  
  <pre><code>$req = $bdd-&gt;prepare('SELECT * FROM news WHERE id= ? ');
          $res = $req-&gt;execute(array($id));
          return $res;
  </code></pre>
  
  <p>To pull out the news which id is $id. I'm returning $req to the controller, which is making it follow with </p>
  
  <pre><code>$data['news']= $this-&gt;News-&gt;get_main($_POST['id']);
          $this-&gt;layout-&gt;view('admin/newsmod',$data);
  </code></pre>
  
  <p>And when it comes to the newsmod page:</p>
  
  <pre><code>&lt;?php
  while ($donnees = $news-&gt;fetch())
  {
  ?&gt;
  </code></pre>
  
  <p>Boom! </p>
  
  <blockquote>
    <p>Fatal error: Call to a member function fetch() on a non-object in views/admin/newsmod.php on line 3. </p>
  </blockquote>
  
  <p>My PDO connection is finished with </p>
  
  <pre><code>, array(PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION));
  </code></pre>
  
  <p>but still nothing else comes out</p>