I am using CodeIgniter Backup database utility class. But it is giving me an error of
Unsupported feature of the database platform you are using.
Filename: E:\xampp\htdocs\zafarsir\system\database\drivers\mysqli\mysqli_utility.php
Line Number: 82
Here is my code
$this->load->dbutil();
// // Backup your entire database and assign it to a variable
$backup =& $this->dbutil->backup();
// Load the file helper and write the file to your server
$this->load->helper('file');
write_file('http://localhost/zafarsir/database/mybackup.gz', $backup);
// Load the download helper and send the file to your desktop
$this->load->helper('download');
force_download('mybackup.gz', $backup);
$prefs = array(
'tables' => array('user', 'party'), // Array of tables to backup.
'ignore' => array(), // List of tables to omit from the backup
'format' => 'txt', // 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' => "
" // Newline character used in backup file
);
$this->dbutil->backup($prefs);
It is giving me error on this line
$backup =& $this->dbutil->backup();
I am new to CodeIgniter plz helpe me
function backup_Eventtable() {
$this->load->dbutil();
$prefs = array(
//'tables' => array('hotel_accomodation'), // Array of tables to backup.
'ignore' => array(), // List of tables to omit from the backup
'format' => 'txt', // gzip, zip, txt
'filename' => ''.date("Y-m-d-H-i-s").'-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' => "
" // Newline character used in backup file
);
$backup =& $this->dbutil->backup($prefs);
//I tried it with and without the next 2 Lines.
$this->load->helper('file');
write_file('backup_db/'.date("Y-m-d-H-i-s").'-mybackup.sql', $backup);
}
try this code, may be useful....