php语言

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

时间:2024-11-03 23:31:15 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框架备份数据库】相关文章:

怎么在yaf框架增加php扩展框架07-24

PHP框架是什么09-23

php数据库备份脚本05-25

重新认识PHP框架08-27

PHP数据库备份脚本的方法09-10

php备份数据库类的方法09-04

PHP MVC框架路由学习笔记07-02

PHP数据库备份脚本的方法技巧10-25

PHP中Yii框架之表单验证规则06-08

10个技巧优化PHP程序Laravel 5框架08-31