The thing is that I need to write a db class with mysqli and it should support multiple connections to different databases. I know that multiple connections is bad, but I don't have any other choice.
If there is any good example of class which supports multiple connections?
Do you know any tips that I should take into consideration when I will start writing the class? What is the best practice in my case?
Thanks in advance,
First thing that comes to mind, is a container class, that stores MySQLi object in it. Something like this:
Without knowing more about functionality required, it's hard to say if this is a good idea though ;)
More info about SplObjectStorage class.