title: Backup MySQL database with CodeIgniter
body: <p>I have been looking into the user guide which came with CodeIgniter. I became very interested with the <code>dbutil()</code> method. Particularly the following line of code:</p>
  
  <pre><code>// Load the DB utility class
  $this-&gt;load-&gt;dbutil();
  
  // Backup your entire database and assign it to a variable
  $backup =&amp; $this-&gt;dbutil-&gt;backup(); 
  
  // Load the file helper and write the file to your server
  $this-&gt;load-&gt;helper('file');
  write_file('/path/to/mybackup.gz', $backup); 
  
  // Load the download helper and send the file to your desktop
  $this-&gt;load-&gt;helper('download');
  force_download('mybackup.gz', $backup); 
  </code></pre>
  
  <p>It is supposed to backup the currently loaded MySQL database. But unfortunately, it is not working and I get the following message:</p>
  
  <blockquote>
    <p>A PHP Error was encountered</p>
    
    <p>Severity: Notice</p>
    
    <p>Message: Undefined property: CI_Loader::$dbutil</p>
    
    <p>Filename: views/view.php</p>
    
    <p>Line Number: 10</p>
    
    <p>Fatal error: Call to a member function backup() on a non-object in
    C:\xampp\htdocs\CodeIgniter\application\views\view.php on line 10</p>
  </blockquote>
  
  <p>What am I missing here? Any help would be really appreciated.</p>