- 相關(guān)推薦
PHP框架:CodeIgniter框架備份數(shù)據(jù)庫(kù)
每一練習(xí)都是一次積淀,最終我們會(huì)成就不一樣的自己。下面是小編整理的CodeIgniter框架備份數(shù)據(jù)庫(kù),希望對(duì)大家學(xué)習(xí)PHP有用,更多消息請(qǐng)關(guān)注應(yīng)屆畢業(yè)生網(wǎng)。
導(dǎo)出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.sql',$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('mybackup.gz',$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.zip',$backup);
【PHP框架:CodeIgniter框架備份數(shù)據(jù)庫(kù)】相關(guān)文章:
PHP框架是什么09-23
重新認(rèn)識(shí)PHP框架08-27
PHP數(shù)據(jù)庫(kù)備份腳本的方法09-10
php備份數(shù)據(jù)庫(kù)類的方法09-04
PHP數(shù)據(jù)庫(kù)備份腳本的方法技巧10-25