title: mysqli - fetch_Array error call to a member function fetch_array() on a non-object mysqli
body: <p>I am new to mysqli and started trying to learn basic things.  With respect to this i example (<a href="http://php.net/manual/en/mysqli-result.fetch-array.php" rel="noreferrer">http://php.net/manual/en/mysqli-result.fetch-array.php</a>) i was trying fetch_array. Here is my code.</p>
  
  <pre><code>$sqlGetChartData    =   "SELECT date, ratepersqft, location 
                            FROM ratepersqft
                           WHERE project_id = 1";
  $runGetChartData    =   $mysqli-&gt;query($sqlGetChartData);
  
  while($rowGetChartData = $runGetChartData-&gt;fetch_array(MYSQLI_BOTH))
      $arrGetChartData[]  =   $rowGetChartData;
  
      print "&lt;pre&gt;";
      print_r($arrGetChartData);
      exit();
  </code></pre>
  
  <p>Here i am getting this error Call to a member function fetch_array() on a non-object  on line next to while condition line.  I tried googling it and did not get result for my problem.  Hope my question is clear.  Thanks in Advance.</p>