title: PHP Fatal error: Call to undefined method mysqli::mysqli_fetch_all()
body: <p>hoping someone can help me, I am having the following error, looked online and tried a load of things but can't seem to figure it out, error: </p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method mysqli::mysqli_fetch_all() in C:\xampp\htdocs\cyberglide\core-class.php on line 38</p>
  </blockquote>
  
  <p>heres my code:</p>
  
  <pre><code>&lt;?php
  
  class Core {
  
  function db_connect() {
      global $db_username;
      global $db_password;
      global $db_host;
      global $db_database;
  
      static $conn;
  
      $conn = new mysqli($db_host, $db_username, $db_password, $db_database);
  
      if ($conn-&gt;connect_error) {
          return '&lt;h1&gt;'."Opps there seems to be a problem!".'&lt;/h1&gt;'.'&lt;p&gt;'."Your Config file is not setup correctly.".'&lt;/p&gt;';
      }
      return $conn;
  }
  
  function db_content() {
      //this requires a get, update and delete sections, before its complete
  
      $conn = $this-&gt;db_connect();
  
      if(mysqli_connect_errno()){
          echo mysqli_connect_error();
  }
  $query = "SELECT * FROM content";
  
  // Escape Query
  $query = $conn-&gt;real_escape_string($query);
  
  // Execute Query
  if($result = $conn-&gt;query($query)){
  
          // Cycle through results
          while($row = $conn-&gt;mysqli_fetch_all()){
              //echo $row-&gt;column;
             }
         }
     }
  }
  
  $core = new Core();
  
  ?&gt;
  </code></pre>
  
  <p>I am trying to create a db_connect function, which I want to be able to call anywhere on the site that needs a database connection, I am trying to call that function on a function within the same class, I want it to grab and display the results from the database. I am running PHP 5.4.7, I am calling the database on a blank php file which includes a require to include the class file, then using this at the moment $core->db_content(); to test the function. I am building this application from scratch, running from MySQLi guides (not used MySQLi before, used to use normal MySQL query's) so if I am doing anything wrong please let me know, thanks everyone.</p>