Welcome Guest, Not a member yet? Register   Sign In
Unsupported feature of the database platform you are using.
#1

(This post was last modified: 02-22-2021, 05:36 PM by masanabdiwicaksono.)

Hi,

How to use backup function in codeigniter 4, i am using method from codeigniter 3 and it won't work.

Showing Error : CodeIgniter\Database\Exceptions\DatabaseException Unsupported feature of the database platform you are using.


Code:
public function backup()
    {
        $model = new class extends \CodeIgniter\Model
        {
            protected $table      = 'tb_envelope';
            protected $primaryKey = 'id_envelope';
        };
        $db = \Closure::bind(function ($model) {
            return $model->db;
        }, null, $model)($model);

        $util = (new \CodeIgniter\Database\Database())->loadUtils($db);

        $date= date('YmdS-His');

        $config = [
            'format' => 'zip',
            'filename' => 'My_' . $date . '_db.sql',
            'add_drop' => TRUE,
            'add_insert' => TRUE,
            'newline' => "\n",
            'foreign_key_checks' => FALSE,
        ];

        $backup = $util->backup($config);
        $file_name= 'My_' . $tanggal . '.zip';
        helper('download');
        $this->response->download($file_name, $backup);

Thank You Big Grin
Reply
#2

(This post was last modified: 02-22-2021, 11:01 PM by kenjis.)

As showing the error, CI4 does not have the method.

See https://codeigniter4.github.io/CodeIgnit...ities.html
Reply
#3

You can manually do it.

Backup/Restore MySql database using PHP
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

Thanks a lot Big Grin Big Grin
Reply




Theme © iAndrew 2016 - Forum software by © MyBB