Welcome Guest, Not a member yet? Register   Sign In
Transaction on two db
#1

hi , to do transaction i use this code 

[/CODE]
                    $db = \Config\Database::connect();

                    $db->transStart();
                             //CODE
                   $db->transComplete();


                    if($db->transStatus()!==false) {

                        //CODE show message ok

                    }else{

                         //CODE show message error
                    }

[/CODE]

I must copy value from one table's db (on same server ) to another db table from another db
  • truncate table dbA_tableMaterial
  • SELECT * FROM table dbB_tableMaterial
  • foreach value of mysql select insert value on table dbA_tableMaterial
It's possble use transaction ?
Reply
#2

Not positive but maybe nested transactions.

CodeIgniter 4 User Guide - Transactions - Nested Transactions
What did you Try? What did you Get? What did you Expect?

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

See https://stackoverflow.com/questions/3399...with-mysql
Reply




Theme © iAndrew 2016 - Forum software by © MyBB