CodeIgniter数据库备份引号

时间:2018-04-16 11:01:21

标签: php mysql database codeigniter mysql-backup

我想备份一个成功备份的数据库,但无法检索内容。例如,缺少引号。

public function backup()
{
    $fileName=date("Y-m-d h:i:sa").".zip";
    // Load the DB utility class
    $this->load->dbutil();

    $prefs = array(
        'format'      => 'zip',
        'filename'    => date("Y-m-d h:i:sa").'.sql',
        'ignore'     => array(),


        'add_drop'   => TRUE,
        'add_insert' => TRUE,
        'newline'    => "\n"
    );
    // Backup your entire database and assign it to a variable
    $backup =& $this->dbutil->backup($prefs);

    // Load the file helper and write the file to your server
    $this->load->helper('file');
    write_file(FCPATH.'/downloads/'.$fileName, $backup);

    // Load the download helper and send the file to your desktop
    $this->load->helper('download');
    force_download($fileName, $backup);
}

但收到的备份内容

    INSERT INTO `product` (`urun_stok_kodu`, `urun_adi`, `urun_kat`) VALUES (1-100-10-5, Altıgen Yeşil 10luk, 1);
INSERT INTO `product` (`product_stock_code`, `product_name`, `product_menu`) VALUES (1-100-10-1, Altıgen Kahverengi 10luk, 1);
INSERT INTO `product` (`product_stock_code`, `product_name`, `product_menu`) VALUES (1-100-10-2, Altıgen Kırmızı 10luk, 1);
INSERT INTO `product` (`product_stock_code`, `product_name`, `product_menu`) VALUES (1-100-10-6, Altıgen Mavi 10luk, 1);
INSERT INTO `product` (`product_stock_code`, `product_name`, `product_menu`) VALUES (1-100-10-4, Altıgen Sarı 10luk, 1);

以这种方式进行备份,但实际上是:

INSERT INTO `product` (`product_stock_code`, `product_name`, `product_menu`) VALUES ('1-100-10-4', 'Altıgen Sarı 10luk', '1');

你知道这可能是什么问题吗?感谢。

0 个答案:

没有答案