title: How to solve 'Fatal error: Call to undefined method mysqli_stmt::fetchAll'?
body: <p>I followed a tutorial about taking students attendance. But, it doesn't give results that should be done. Instead, it gives me this:
  <code>Fatal error: Call to undefined method mysqli_stmt::fetchAll() in C:\xampp\htdocs\ah\includes\functions.php on line 62</code></p>
  
  <p>This is where the <code>fetchAll</code> is located:</p>
  
  <pre><code>function get_all_std($conn,$table,$limit){
  
          try {
              $query = "SELECT * FROM {$table} ORDER BY  std_roll_no LIMIT {$limit}";
                  $stmt = $conn-&gt;prepare( $query );
                  $stmt-&gt;execute();
                  return $stmt-&gt;fetchAll();
  
          } catch (Exception $e) {
              return "ERROR". $e-&gt;getMessage();
          }
  
        }
  </code></pre>
  
  <p>And this is where the <code>function</code> <code>get_all_std</code> :</p>
  
  <pre><code>&lt;?php        
          $view = $db-&gt;get_all_std($conn,'student_table',10);
          foreach ($view as $post) {
          $std_id = $post['std_roll_no'];
  
        echo '&lt;tr&gt;';
  
          // echo '&lt;td&gt;'. $post['student_id'] . '&lt;/td&gt;';          
          echo '&lt;td&gt;'. $post['student_name'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['dob'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['gender'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['email'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['phone'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['address'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['Session'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['Program'] . '&lt;/td&gt;';
          echo '&lt;td&gt;'. $post['Semester'] . '&lt;/td&gt;';
  
          echo '&lt;td width=250&gt;';
          echo "&lt;div class='ui mini buttons'&gt;";
          echo '&lt;a class="ui mini positive button" href="student_update.php?std_roll_no='.$post['std_roll_no'].'"&gt; &lt;i class="glyphicon glyphicon-pencil"&gt;&lt;/i&gt;Update&lt;/a&gt;';
          echo "&lt;div class='or'&gt;&lt;/div&gt;";    
          echo '&lt;a class="ui mini red button" href="student.php?std_roll_no='.$post['std_roll_no'].'"&gt;&lt;i class="glyphicon glyphicon-remove"&gt; &lt;/i&gt;Delete&lt;/a&gt;';
          echo "&lt;/div&gt;";
          echo '&lt;/td&gt;';    
         echo '&lt;/tr&gt;';  
          }
         ?&gt;
  </code></pre>
  
  <p>So I would like to know how to solve this, because I already researched in the internet but none can solve my problem.</p>
  
  <p>Thanks.</p>