title: php -$result->fetch_array does not work
body: <p>I am trying to select a table within my database with a GET Method.
  Now when I hardcode the value of the variable in there (the table name) it works as expected and it returns the values in an array.</p>
  
  <p>But when I try to determine the table name through a variable, I get the following error:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function fetch_array() on a non-object in</p>
  </blockquote>
  
  <p>Now I have tried the <code>var_dump($result);</code> but that returns <code>bool(false)</code>.</p>
  
  <p>Now the variable does carry a value, because when I echo it back to the screen it gives the value I would expect.</p>
  
  <p>So why does not return the value when making the query for my table search???</p>
  
  <pre><code>     $result = $mysqli-&gt;query("SELECT * FROM PodcastSermons  WHERE sermonSeries = ". $series); //This where a change needs to happen
  
      var_dump($result);
  
          $posts = array();
  
          while($row = $result-&gt;fetch_array()) 
          {    
              $ID=$row['ID'];
              $sermonTitle=$row['sermonTitle'];
              $sermonSpeaker=$row['sermonSpeaker'];
              $sermonSeries=$row['sermonSeries'];
              $sermonDate=$row['sermonDate'];
              $linkToImage=$row['linkToImage'];
              $linkToAudioFile=$row['linkToAudioFile'];
  
              $posts []= array (
                  'ID'=&gt; $ID,
                  'sermonTitle'=&gt; $sermonTitle,
                  'sermonSpeaker'=&gt; $sermonSpeaker,
                  'sermonSeries'=&gt; $sermonSeries,
                  'sermonDate'=&gt; $sermonDate,
                  'linkToImage'=&gt; $linkToImage,
                  'linkToAudioFile'=&gt; $linkToAudioFile
              );
      }
  
      $response['posts'] = $posts;
  
      var_dump($posts);
  </code></pre>
  
  <p>PS I have read about the depreciation in mysql style and that I know have to use mysqli writing. I am running PHP Version 5.2.6-1+lenny16</p>