Welcome Guest, Not a member yet? Register   Sign In
backup database problem
#1

hi this is my controller :

Code:
public function backup_database(){

       $data=[];

       $oggi=date ("d-m-Y");

       // Load the DB utility class
       $this->load->dbutil();

       // Backup your entire database and assign it to a variable
       $backup = $this->dbutil->backup();

       $this->load->library('zip');

       // Load the file helper and write the file to your server
       $this->load->helper('file');

       if(write_file("backup_db/backup".$oggi.".txt", $backup)){
           $this->load->view('templates/header_admin');
           $this->load->view('templates/menu_admin');
           $this->load->view('admin/db_backup_ok', $data);
           $this->load->view('templates/footer_admin');


       }else{
          $this->load->view('templates/header_admin');
           $this->load->view('templates/menu_admin');
           $this->load->view('admin/db_backup_error', $data);
           $this->load->view('templates/footer_admin');

       }




   }

It work but the file made with this command have problem , if i set txt i have the document isn't a valid UTF-8 .
If i set zip , the archive cannot open ....

How can i solve ?
Reply


Messages In This Thread
backup database problem - by pippuccio76 - 01-17-2018, 02:47 PM
RE: backup database problem - by InsiteFX - 01-18-2018, 04:47 AM
RE: backup database problem - by pippuccio76 - 01-18-2018, 05:14 AM
RE: backup database problem - by InsiteFX - 01-18-2018, 10:05 AM
RE: backup database problem - by pippuccio76 - 01-18-2018, 11:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB