2

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

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

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

4

0 回答 0