Let's say I want to run same queries on two different databases in ZEND ? What's the best solution for this?
2 Answers
Let me introduce you to ORM.
You might want to download and use Doctrine2 , it hardly takes a day or 2 to learn it and using createQueryBuilder SQL scripting is just easier considering you know the logics to use JOIN, etc.
Try Doctrine CLI for beginning, once you are good to go, you might go manual with it!
Enjoy coding!
Comments
Create an adapter (proxy really) that will execute the queries on it's own internal adapters. But you need to take care of the situation where one of the calls fail or the results are not the same.
If your use-case is replication of the databases, I suggest using the ready made solution