CodeIgniter Forums
dbutil() produces database error for MySQL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: dbutil() produces database error for MySQL (/thread-58296.html)



dbutil() produces database error for MySQL - El Forum - 05-31-2013

[eluser]Ornis[/eluser]
Hi

I am getting an error

A Database Error Occurred

Unsupported feature of the database platform you are using

while running the following code

Code:
// Load the DB utility class
  $this->load->dbutil();
  
  //=== set preferences
  $prefs = array(
                'tables'      => array('mytable'),  // Array of tables to backup.
                'ignore'      => array(),           // List of tables to omit from the backup
                'format'      => 'gzip',            // gzip, zip, txt
                'filename'    => 'mybackup.sql',    // File name - NEEDED ONLY WITH ZIP FILES
                'add_drop'    => TRUE,              // Whether to add DROP TABLE statements to backup file
                'add_insert'  => TRUE,              // Whether to add INSERT data to backup file
                'newline'     => "\n"               // Newline character used in backup file
              );
        
  // Backup your entire database and assign it to a variable
  $backup = $this->dbutil->backup($prefs);

  // Load the file helper and write the file to your server
  $this->load->helper('file');
  write_file($this->data['gz_folder'] . '/mybackup.gz', $backup);

  // Load the download helper and send the file to your desktop
  $this->load->helper('download');
  force_download('mybackup.gz', $backup);

dbutil seems to point to the correct database. So I don't know, what I'm missing here.




dbutil() produces database error for MySQL - El Forum - 06-03-2013

[eluser]Ornis[/eluser]
I find out that dbutil->backup() is not supported when using the mysqli extension. It runs fin with mysql extension. Why that? Confusedmirk: