Unfortunately I have to interact with multiple databases with different USER and PASSOWRD.
Instead of creating copies of the config.php file, how I can override a variable:
Camilo Sperberg - 2010-06-09 16:10:20 - In reply to message 1 from Valentino Lauciani
Hi Valentino, thanks for your feedback :)
Unfortunately you can't do this with this class unless you modify it. (A lot). Why? Because only 1 db instance can be invoked with this class so trying to connect simultaneously to another with be pointless according to the class's basic principles.
If you really want to do this, I suggest taking out the DB_connect class and on the __construct method of the DB_mysql class adding this:
Camilo Sperberg - 2010-06-10 03:52:08 - In reply to message 3 from Valentino Lauciani
oh no no no ... if you look carefully, you can see that the package are 2 classes. You should just (only) delete the DB_connect class. If you want to connect to multiple databases, that class (which avoids cloning AKA establishing another connection) is useless to you.
So, you should just delete it.
In the remaining class, you should apply on the __construct method all the changes previously exposed.