debussy007 wrote:
> 
> Hi,
> 
> I am using classes extending the Zend_Db_Table_Abstract class.
> The Zend_Db_Table_Abstract will use the default adapter to fetch data.
> 
> When I need to fetch data from one DB and then another, I don't know how
> to handle it. 
> I would have, according to the API, to change of adapter, which implies I
> need to connect to the same server again to use another database !
> 
> However it should be possible to query several database from on connection
> to the server.
> I would like to see a method which allows to switch default database.
> 
> So temporarly, I must create my own fetchAll, fetchRow, etc. just to
> prefix the queries with the appropriate DB (( it's quite arduous.
> 
> I hope I was clear.
> 
> Thank you for any tips !!
> 

In my opinion, what you're trying to do isn't "clean" and is bad usage of a
Zend_Db_Table. It's not meant to be used when you're changing the source
database on the fly. Yeah, create a second connection, and use a different
instance of Zend_Db_Table.

If there's no other choice, yeah, override Zend_Db_Table, but you'll be
polluting it with a "multi DB" notion that it doesn't handle at it's root.
It won't be pretty :-)
-- 
View this message in context: 
http://www.nabble.com/Fetch-data-from-several-Databases-with-Zend_Db_Table_Abstract-tp22118827p22125364.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to