php框架

 首页 > php框架 > CodeIgniter框架备份数据库

CodeIgniter框架备份数据库

分享到:
【字体:
导读:
          导出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-...

导出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);
 
分享到:
Codeigniter购物车类不能添加中文的解决...
本文实例讲述了Codeigniter购物车类不能添加中文的解决方法。分享给大家供大家参考。具体分析如下: 有朋友可能会发现Codeigniter 购物车类不能添加中文,我找了N久才发现下面一段代码限制了输入中文了,修改systemlibrariesCart.php,注释第186-190行产品名称的判断,代码如下: 复制代码代码如下: if ( ! preg_...
CodeIgniter数据库的使用
载入database,   $this->load->database(); 也可在config文件夹下的autoload.php文件中修改: $autoload['libraries'] =array('database'); 这样,就可以使用了。 查询单条数据:   $this->db->select('title, content, date'); $query=$this->db->g...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……