1

Let's say I want to run same queries on two different databases in ZEND ? What's the best solution for this?

2 Answers 2

1

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!

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.