Switching databases connection for use with $this->load->dbutil(); |
[eluser]RECOHA[/eluser]
Hello Guys, Sorry about the english, but I've a doubt about one thing. Code: public function fazBackup() This code returns: Code: A PHP Error was encountered I can't do this or I'm doing wrong? Ty.
[eluser]Christopher Blankenship[/eluser]
I am not exactly sure what you are attempting to do but maybe these links may help with your problem. Codeigniter with Multiple Database Support Codeigniter User Guide Codeigniter Forum::connect to multiple databases
[eluser]RECOHA[/eluser]
I'm trying to backup an external databases with dbutil() class. I guess dbutil() class just can use with the databases setup in databases.php.
[eluser]Christopher Blankenship[/eluser]
You can use dbutil() to backup databases and multiple databases at that you just need to setup the databases like shown in the links I provided above then call the one you are wanting to backup.
[eluser]RECOHA[/eluser]
But, I want to backup a lot of MySQL databases. Look, I have an database in my server containing the informations of another databases and I want to connect one to one at a time to backup them with dbutil() class. Is that possible?
[eluser]danmontgomery[/eluser]
You can't load from a database object, you load from the CI object. The dbutil class uses whatever is assigned to $this->db. Code: public function fazBackup() If you're doing this across multiple databases, you still want to explicitly assign the object, because even though CI assigned the db to $this->db, if one is already loaded it won't load it again unless you tell it to. You probably want to also include a call to $this->db->close() between switching databases.
[eluser]RECOHA[/eluser]
Thanks Lab Technician, but the code that you posted above don't work here. Code: A Database Error Occurred Sincerely. |
Welcome Guest, Not a member yet? Register Sign In |