![]() |
Which database will the system choose to insert the record ?? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Which database will the system choose to insert the record ?? (/showthread.php?tid=3854) |
Which database will the system choose to insert the record ?? - El Forum - 10-25-2007 [eluser]cinewbie81[/eluser] The following is my database config file setting: Code: $active_group = "db1"; And here's my code: Code: $DB1 = $this->load->database('db1', TRUE); Let's assume that both db1 and db2 have the exactly the same database structure. My question is when i call $this->db->insert('mytable', $data) statement, the system will save the data in db1 or db2? How can i manually control which db i want the data to be inserted ? Anyone ? Which database will the system choose to insert the record ?? - El Forum - 10-25-2007 [eluser]xwero[/eluser] Instead of $this->db you have to do $DB1->insert or $DB2->insert. Which database will the system choose to insert the record ?? - El Forum - 10-25-2007 [eluser]cinewbie81[/eluser] Opps .. that's the easy one .. how could i don't know that .. Looks like the workload is up to my head now .. it's time to take a rest .. many thanks xwero !! |