每一練習都是一次積澱,最終我們會成就不一樣的自己。下面是小編整理的CodeIgniter框架備份資料庫,希望對大家學習PHP有用,更多訊息請關注應屆畢業生網。 匯出txt格式: // Load the DB utility class $this->load->dbutil(); // Backup your entire database and assign it to a variable $backup=&$this->dbutil->backup(array('format'=>'txt')); // Load the file helper and write the file to your server $this->load->helper('file'); write_file('',$backup); gzip格式: // Load the DB utility class $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('',$backup); zip格式 // Load the DB utility class $this->load->dbutil(); // Backup your entire database and assign it to a variable $backup=&$this->dbutil->backup(array('format'=>'zip')); // Load the file helper and write the file to your server $this->load->helper('file'); write_file('',$backup);