php语言 百分网手机站

PHP框架:CodeIgniter框架备份数据库

时间:2020-10-10 19:02:12 php语言 我要投稿

PHP框架:CodeIgniter框架备份数据库

  每一练习都是一次积淀,最终我们会成就不一样的自己。下面是小编整理的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.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框架备份数据库】相关文章:

1.php框架Phpbean说明

2.PHP框架的概念

3.如何使用PHP框架

4.php语言能用框架吗

5.php十大开源框架

6.PHP 开源框架22个简单简介

7.php常见的框架及优缺点

8.备份php数据库脚本的方法

9.优化PHP程序Laravel 5框架的技巧