Welcome Guest, Not a member yet? Register   Sign In
Using db backup util to copy table to another database
#1

[eluser]louis w[/eluser]
But running into problems... Is it escaping the raw sql?

A Database Error Occurred

Error Number: 1064

Code:
$this->load->dbutil();

            // Get copy of data in local table
            
            $backup_config     = array(
                'tables'     => array('config')
                , 'format'    => 'txt'
                );
            $backup_data     =& $this->dbutil->backup($backup_config);

            // Connect to remote database
            $remote_db         = $this->load->database('web_db', TRUE);
            $remote_result     = $remote_db->query($backup_data);

I could select the data as a result object and iterate through it to run insert query for each row, but I am hoping to streamline it into one query. Maybe not possible.


Messages In This Thread
Using db backup util to copy table to another database - by El Forum - 03-18-2009, 02:48 PM
Using db backup util to copy table to another database - by El Forum - 03-18-2009, 05:04 PM
Using db backup util to copy table to another database - by El Forum - 03-18-2009, 05:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB