codeigniter数据库备份引号

sqserrrh  于 2021-06-21  发布在  Mysql
关注(0)|答案(0)|浏览(271)

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

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');

你知道问题出在哪里吗?谢谢。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题