<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using the Zend Framework with Multiple Databases</title>
	<atom:link href="http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/</link>
	<description>Jaybill McCarthy&#039;s blog.</description>
	<lastBuildDate>Mon, 01 Mar 2010 20:39:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Steve Dowe</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-547</link>
		<dc:creator>Steve Dowe</dc:creator>
		<pubDate>Tue, 26 Jan 2010 09:03:53 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-547</guid>
		<description>Great tip, thanks very much.

For those who are having trouble implementing this after following a Zend Framework tutorial, note that the Orders class declaration will go into models/DbTable/Orders.php and not models/Orders.php.

This is because you are abstracting the Zend_Db_Table class.

HTH somebody!</description>
		<content:encoded><![CDATA[<p>Great tip, thanks very much.</p>
<p>For those who are having trouble implementing this after following a Zend Framework tutorial, note that the Orders class declaration will go into models/DbTable/Orders.php and not models/Orders.php.</p>
<p>This is because you are abstracting the Zend_Db_Table class.</p>
<p>HTH somebody!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-11-07 &#124; AndySowards.com :: Professional Web Design, Development, Programming Freelancer, Hacks, Downloads, Math and being a Web 2.0 Hipster?</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-409</link>
		<dc:creator>links for 2009-11-07 &#124; AndySowards.com :: Professional Web Design, Development, Programming Freelancer, Hacks, Downloads, Math and being a Web 2.0 Hipster?</dc:creator>
		<pubDate>Sat, 07 Nov 2009 10:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-409</guid>
		<description>[...] Jaybill.com » Using the Zend Framework with Multiple Databases Another good look at Zend DB &#8211; This time tackling the problem of needing to access 2 databases instead of just one. (tags: zend database php zendframework multiple db tutorial framework) [...]</description>
		<content:encoded><![CDATA[<p>[...] Jaybill.com » Using the Zend Framework with Multiple Databases Another good look at Zend DB &#8211; This time tackling the problem of needing to access 2 databases instead of just one. (tags: zend database php zendframework multiple db tutorial framework) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-11-06 &#124; AndySowards.com :: Professional Web Design, Development, Programming Freelancer, Hacks, Downloads, Math and being a Web 2.0 Hipster?</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-407</link>
		<dc:creator>links for 2009-11-06 &#124; AndySowards.com :: Professional Web Design, Development, Programming Freelancer, Hacks, Downloads, Math and being a Web 2.0 Hipster?</dc:creator>
		<pubDate>Fri, 06 Nov 2009 18:23:32 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-407</guid>
		<description>[...] Jaybill.com » Using the Zend Framework with Multiple Databases Another good look at Zend DB &#8211; This time tackling the problem of needing to access 2 databases instead of just one. (tags: zend database php zendframework multiple db tutorial framework) [...]</description>
		<content:encoded><![CDATA[<p>[...] Jaybill.com » Using the Zend Framework with Multiple Databases Another good look at Zend DB &#8211; This time tackling the problem of needing to access 2 databases instead of just one. (tags: zend database php zendframework multiple db tutorial framework) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaybill McCarthy</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-398</link>
		<dc:creator>Jaybill McCarthy</dc:creator>
		<pubDate>Tue, 27 Oct 2009 15:44:41 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-398</guid>
		<description>@chris jones - It&#039;s not your ini file that&#039;s missing, it&#039;s the Zend Framework. &quot;Fatal Error: Class ‘Zend_config_Ini’ not found in /path/to/index.php on line 6&quot; means that your script can&#039;t find the Zend Framework classes. Check your include path or add the following line to your index.php


set_include_path(get_include_path() . PATH_SEPARATOR . &quot;/path/to/ZendFramework/Zend&quot;);


Make sure your include path is to the folder that contains &quot;library&quot;.</description>
		<content:encoded><![CDATA[<p>@chris jones &#8211; It&#8217;s not your ini file that&#8217;s missing, it&#8217;s the Zend Framework. &#8220;Fatal Error: Class ‘Zend_config_Ini’ not found in /path/to/index.php on line 6&#8243; means that your script can&#8217;t find the Zend Framework classes. Check your include path or add the following line to your index.php</p>
<p>set_include_path(get_include_path() . PATH_SEPARATOR . &#8220;/path/to/ZendFramework/Zend&#8221;);</p>
<p>Make sure your include path is to the folder that contains &#8220;library&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris jones</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-397</link>
		<dc:creator>chris jones</dc:creator>
		<pubDate>Tue, 27 Oct 2009 12:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-397</guid>
		<description>I came across this webpage and seeing as the post are quite recent I hope you can help. I am hoping you can shed some light on this problem.

I have the config.ini in the correct directory and I have also specified the section as [general] in the config.ini file and created the line on the index.php 
$config = new Zend_Config_Ini(‘./application/config.ini’, ‘general’);

When executing the page, all i get is:
Fatal Error: Class &#039;Zend_config_Ini&#039; not found in /path/to/index.php on line 6

I&#039;ve tried moving the config.ini to different dirs and using every possible path suggestion to point at it like ./ ../ //full_path_from_hard_drive/config.ini but cant get it to work

Any ideas??</description>
		<content:encoded><![CDATA[<p>I came across this webpage and seeing as the post are quite recent I hope you can help. I am hoping you can shed some light on this problem.</p>
<p>I have the config.ini in the correct directory and I have also specified the section as [general] in the config.ini file and created the line on the index.php<br />
$config = new Zend_Config_Ini(‘./application/config.ini’, ‘general’);</p>
<p>When executing the page, all i get is:<br />
Fatal Error: Class &#8216;Zend_config_Ini&#8217; not found in /path/to/index.php on line 6</p>
<p>I&#8217;ve tried moving the config.ini to different dirs and using every possible path suggestion to point at it like ./ ../ //full_path_from_hard_drive/config.ini but cant get it to work</p>
<p>Any ideas??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-391</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Wed, 07 Oct 2009 23:06:32 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-391</guid>
		<description>I have insert in boostrap &quot;Zend_Registry::set(&#039;config&#039;, $dbAdapters);&quot;

but i have &quot;no entry is registered for key config&quot;</description>
		<content:encoded><![CDATA[<p>I have insert in boostrap &#8220;Zend_Registry::set(&#8216;config&#8217;, $dbAdapters);&#8221;</p>
<p>but i have &#8220;no entry is registered for key config&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-390</link>
		<dc:creator>Carlos</dc:creator>
		<pubDate>Wed, 09 Sep 2009 09:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-390</guid>
		<description>i can connect to my DB&#039;s, so when i do a query: $licensasTable = new App_Models_Licencas();
$licensa = $licensasTable-&gt;fetchRow($licensasTable-&gt;select());

i have the error: Notice: Trying to get property of non-object

My Licencas model is:
class App_Models_Licencas extends Zend_Db_Table_Abstract
{
    protected $_name = &#039;licencas&#039;;
    protected $_primary = &#039;ID&#039;; 
    protected $_use_adapter = &#039;iqdoclicencas&#039;;
}

i&#039;m doing something wrong?</description>
		<content:encoded><![CDATA[<p>i can connect to my DB&#8217;s, so when i do a query: $licensasTable = new App_Models_Licencas();<br />
$licensa = $licensasTable-&gt;fetchRow($licensasTable-&gt;select());</p>
<p>i have the error: Notice: Trying to get property of non-object</p>
<p>My Licencas model is:<br />
class App_Models_Licencas extends Zend_Db_Table_Abstract<br />
{<br />
    protected $_name = &#8216;licencas&#8217;;<br />
    protected $_primary = &#8216;ID&#8217;;<br />
    protected $_use_adapter = &#8216;iqdoclicencas&#8217;;<br />
}</p>
<p>i&#8217;m doing something wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaybill McCarthy</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-386</link>
		<dc:creator>Jaybill McCarthy</dc:creator>
		<pubDate>Mon, 11 May 2009 17:13:01 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-386</guid>
		<description>@Arthur  - The error message you&#039;re getting is telling you exactly what happened, actually. Line 8 of your config.ini file is:

db.dado6.default = truedb.cliente.adapter = PDO_MYSQL

That&#039;s wrong. Should have a line break after &quot;true&quot;.</description>
		<content:encoded><![CDATA[<p>@Arthur  &#8211; The error message you&#8217;re getting is telling you exactly what happened, actually. Line 8 of your config.ini file is:</p>
<p>db.dado6.default = truedb.cliente.adapter = PDO_MYSQL</p>
<p>That&#8217;s wrong. Should have a line break after &#8220;true&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-384</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Thu, 07 May 2009 03:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-384</guid>
		<description>i´m having some touble... here is my code:
config.ini ....
[databases]
db.dado6.adapter = PDO_MYSQL
db.dado6.config.host = localhost
db.dado6.config.username = root
db.dado6.config.password = 
db.dado6.config.dbname = dado6
db.dado6.default = truedb.cliente.adapter = PDO_MYSQL
db.cliente.config.host = localhost
db.cliente.config.username = root
db.cliente.config.password = 
db.cliente.config.dbname = cliente
......
index.php
...
$databases = new Zend_Config_Ini(&#039;./application/config.ini&#039;, &#039;databases&#039;);
$dbAdapters = array ();
foreach ( $databases-&gt;db as $config_name =&gt; $db ) {
	$dbAdapters [$config_name] = Zend_Db::factory ( $db-&gt;adapter, $db-&gt;config-&gt;toArray () );
	if (( boolean ) $db-&gt;default) {
		Zend_Db_Table::setDefaultAdapter ( $dbAdapters [$config_name] );
	}
}
Zend_Registry::set (&#039;dbAdapters&#039;, $dbAdapters );
...

And the error is:

Warning: Error parsing ./application/config.ini on line 8 in C:\wamp\www\Dado6\library\Zend\Config\Ini.php on line 106

Warning: Invalid argument supplied for foreach() in C:\wamp\www\Dado6\library\Zend\Config\Ini.php on line 108

Fatal error: Uncaught exception &#039;Zend_Config_Exception&#039; with message &#039;Section &#039;databases&#039; cannot be found in ./application/config.ini&#039; in C:\wamp\www\Dado6\library\Zend\Config\Ini.php:156 Stack trace: #0 C:\wamp\www\Dado\admin\index.php(138): Zend_Config_Ini-&gt;__construct(&#039;./application/c...&#039;, &#039;databases&#039;) #1 {main} thrown in C:\wamp\www\Dado6\library\Zend\Config\Ini.php on line 156

does anybody know why is that?
thank you!</description>
		<content:encoded><![CDATA[<p>i´m having some touble&#8230; here is my code:<br />
config.ini &#8230;.<br />
[databases]<br />
db.dado6.adapter = PDO_MYSQL<br />
db.dado6.config.host = localhost<br />
db.dado6.config.username = root<br />
db.dado6.config.password =<br />
db.dado6.config.dbname = dado6<br />
db.dado6.default = truedb.cliente.adapter = PDO_MYSQL<br />
db.cliente.config.host = localhost<br />
db.cliente.config.username = root<br />
db.cliente.config.password =<br />
db.cliente.config.dbname = cliente<br />
&#8230;&#8230;<br />
index.php<br />
&#8230;<br />
$databases = new Zend_Config_Ini(&#8216;./application/config.ini&#8217;, &#8216;databases&#8217;);<br />
$dbAdapters = array ();<br />
foreach ( $databases-&gt;db as $config_name =&gt; $db ) {<br />
	$dbAdapters [$config_name] = Zend_Db::factory ( $db-&gt;adapter, $db-&gt;config-&gt;toArray () );<br />
	if (( boolean ) $db-&gt;default) {<br />
		Zend_Db_Table::setDefaultAdapter ( $dbAdapters [$config_name] );<br />
	}<br />
}<br />
Zend_Registry::set (&#8216;dbAdapters&#8217;, $dbAdapters );<br />
&#8230;</p>
<p>And the error is:</p>
<p>Warning: Error parsing ./application/config.ini on line 8 in C:\wamp\www\Dado6\library\Zend\Config\Ini.php on line 106</p>
<p>Warning: Invalid argument supplied for foreach() in C:\wamp\www\Dado6\library\Zend\Config\Ini.php on line 108</p>
<p>Fatal error: Uncaught exception &#8216;Zend_Config_Exception&#8217; with message &#8216;Section &#8216;databases&#8217; cannot be found in ./application/config.ini&#8217; in C:\wamp\www\Dado6\library\Zend\Config\Ini.php:156 Stack trace: #0 C:\wamp\www\Dado\admin\index.php(138): Zend_Config_Ini-&gt;__construct(&#8216;./application/c&#8230;&#8217;, &#8216;databases&#8217;) #1 {main} thrown in C:\wamp\www\Dado6\library\Zend\Config\Ini.php on line 156</p>
<p>does anybody know why is that?<br />
thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett Griffin</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-380</link>
		<dc:creator>Garrett Griffin</dc:creator>
		<pubDate>Mon, 30 Mar 2009 12:45:49 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-380</guid>
		<description>Thanks a lot for this! Was exactly what I was looking for and you explained it very well.</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this! Was exactly what I was looking for and you explained it very well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Panagiotis Kosmidis</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-273</link>
		<dc:creator>Panagiotis Kosmidis</dc:creator>
		<pubDate>Tue, 05 Aug 2008 01:48:49 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-273</guid>
		<description>Never mind, silly me, was my fault, all ok now, again thanks for article.</description>
		<content:encoded><![CDATA[<p>Never mind, silly me, was my fault, all ok now, again thanks for article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Panagiotis Kosmidis</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-272</link>
		<dc:creator>Panagiotis Kosmidis</dc:creator>
		<pubDate>Tue, 05 Aug 2008 00:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-272</guid>
		<description>Hi, I&#039;m new to ZF also, i like it, i also like your article about multiple databases, the way you took solves from many lines of code. Well everything works great, i can connect to databases, make queries etc, but when i need to authenticate user login with ZF but i get the error: 

exception &#039;Zend_Auth_Adapter_Exception&#039; with message &#039;A value for the identity was not provided prior to authentication with Zend_Auth_Adapter_DbTable.&#039;

My code is:

$dbArray = Zend_Registry::get(&#039;dbAdapters&#039;);
$adapt = new Zend_Auth_Adapter_DbTable ( $dbArray[&#039;sugar&#039;] );
$adapt-&gt;setTableName ( &#039;users&#039; );
$adapt-&gt;setIdentityColumn ( &#039;user_name&#039; );
$adapt-&gt;setCredentialColumn ( &#039;user_hash&#039; );
$adapt-&gt;setCredential ( md5 ( $params [&#039;user_hash&#039;] ) );
$adapt-&gt;setIdentity ( htmlspecialchars ( $params [&#039;user_name&#039;] ) );

i think that i have to pass into Zend_Auth_Adapter_DbTable an Zend_Db_Adapter_Pdo_Mysql object instead of an array thats why i used $dbArray[&#039;sugar&#039;], sugar database contains user authentication data and the other database contains other data.

but if i try:

$adapt = new Zend_Auth_Adapter_DbTable ( Zend_Registry::get(&#039;dbAdapters&#039;) );
$adapt-&gt;setTableName ( &#039;users&#039; );
$adapt-&gt;setIdentityColumn ( &#039;user_name&#039; );
$adapt-&gt;setCredentialColumn ( &#039;user_hash&#039; );
$adapt-&gt;setCredential ( md5 ( $params [&#039;user_hash&#039;] ) );
$adapt-&gt;setIdentity ( htmlspecialchars ( $params [&#039;user_name&#039;] ) );

i will get the error:

Catchable fatal error: Argument 1 passed to Zend_Auth_Adapter_DbTable::__construct() must be an instance of Zend_Db_Adapter_Abstract, array given

so I&#039;m pretty sure that i have to use $dbArrays[&#039;sugar&#039;]

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m new to ZF also, i like it, i also like your article about multiple databases, the way you took solves from many lines of code. Well everything works great, i can connect to databases, make queries etc, but when i need to authenticate user login with ZF but i get the error: </p>
<p>exception &#8216;Zend_Auth_Adapter_Exception&#8217; with message &#8216;A value for the identity was not provided prior to authentication with Zend_Auth_Adapter_DbTable.&#8217;</p>
<p>My code is:</p>
<p>$dbArray = Zend_Registry::get(&#8216;dbAdapters&#8217;);<br />
$adapt = new Zend_Auth_Adapter_DbTable ( $dbArray['sugar'] );<br />
$adapt-&gt;setTableName ( &#8216;users&#8217; );<br />
$adapt-&gt;setIdentityColumn ( &#8216;user_name&#8217; );<br />
$adapt-&gt;setCredentialColumn ( &#8216;user_hash&#8217; );<br />
$adapt-&gt;setCredential ( md5 ( $params ['user_hash'] ) );<br />
$adapt-&gt;setIdentity ( htmlspecialchars ( $params ['user_name'] ) );</p>
<p>i think that i have to pass into Zend_Auth_Adapter_DbTable an Zend_Db_Adapter_Pdo_Mysql object instead of an array thats why i used $dbArray['sugar'], sugar database contains user authentication data and the other database contains other data.</p>
<p>but if i try:</p>
<p>$adapt = new Zend_Auth_Adapter_DbTable ( Zend_Registry::get(&#8216;dbAdapters&#8217;) );<br />
$adapt-&gt;setTableName ( &#8216;users&#8217; );<br />
$adapt-&gt;setIdentityColumn ( &#8216;user_name&#8217; );<br />
$adapt-&gt;setCredentialColumn ( &#8216;user_hash&#8217; );<br />
$adapt-&gt;setCredential ( md5 ( $params ['user_hash'] ) );<br />
$adapt-&gt;setIdentity ( htmlspecialchars ( $params ['user_name'] ) );</p>
<p>i will get the error:</p>
<p>Catchable fatal error: Argument 1 passed to Zend_Auth_Adapter_DbTable::__construct() must be an instance of Zend_Db_Adapter_Abstract, array given</p>
<p>so I&#8217;m pretty sure that i have to use $dbArrays['sugar']</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-271</link>
		<dc:creator>Kris</dc:creator>
		<pubDate>Wed, 23 Jul 2008 23:23:47 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-271</guid>
		<description>Well I found a typo in one of my files, but it still isn&#039;t working.  At least I have a new error message now.  &quot;no entry is registered for key dbAdapters&quot;.  Can anyone help me shed any light on my situation? Thanks!</description>
		<content:encoded><![CDATA[<p>Well I found a typo in one of my files, but it still isn&#8217;t working.  At least I have a new error message now.  &#8220;no entry is registered for key dbAdapters&#8221;.  Can anyone help me shed any light on my situation? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-270</link>
		<dc:creator>Kris</dc:creator>
		<pubDate>Mon, 21 Jul 2008 19:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-270</guid>
		<description>Thanks for covering this topic!  I am having trouble getting it to work with my setup however.  I set up all my files just the same as you except my bootstrap file is different.  I suspect that the problem may have something to do with using the autoload feature.  When I run my app I get an error message that indicates it is looking in the default database even though my derived class is telling it to use the other database. This is what my bootstrap file looks like:

error_reporting(E_ALL&#124;E_STRICT);
ini_set(&#039;display_errors&#039;, 1);
date_default_timezone_set(&#039;America/Los_Angeles&#039;);

// directory setup and class loading
set_include_path(&#039;.&#039; . PATH_SEPARATOR . &#039;../library/&#039;
    . PATH_SEPARATOR . &#039;/var/application/models&#039;
    . PATH_SEPARATOR . get_include_path());
include &quot;Zend/Loader.php&quot;;
Zend_Loader::registerAutoload();  //everthing after this point seems to be the same as what you have

// set up databases

include &quot;App_Db_Table_Abstract.php&quot;;
$databases = new Zend_Config_Ini(&#039;/var/application/config.ini&#039;, &#039;databases&#039;);
$dbAdapters = array();
 foreach($databases-&gt;db as $config_name =&gt; $db)
    {
    $dbAdapters[$config_name] = Zend_Db::factory($db-&gt;adapter,$db-&gt;config-&gt;toArray());
    if((boolean)$db-&gt;default)
        {
        Zend_Db_Table::setDefaultAdapter($dbAdapters[$config_name]);
        }
    }
 Zend_Registry::set(&#039;dbAdapters&#039;,$dbAdapters);

// setup controller
$frontController = Zend_Controller_Front::getInstance();
//change to false before the &quot;unveiling&quot;
$frontController-&gt;throwExceptions(true);
$frontController-&gt;setControllerDirectory(&#039;/var/application/controllers&#039;);
Zend_Layout::startMvc(array(&#039;layoutPath&#039;=&gt;&#039;/var/application/layouts&#039;));

// run!
$frontController-&gt;dispatch();</description>
		<content:encoded><![CDATA[<p>Thanks for covering this topic!  I am having trouble getting it to work with my setup however.  I set up all my files just the same as you except my bootstrap file is different.  I suspect that the problem may have something to do with using the autoload feature.  When I run my app I get an error message that indicates it is looking in the default database even though my derived class is telling it to use the other database. This is what my bootstrap file looks like:</p>
<p>error_reporting(E_ALL|E_STRICT);<br />
ini_set(&#8216;display_errors&#8217;, 1);<br />
date_default_timezone_set(&#8216;America/Los_Angeles&#8217;);</p>
<p>// directory setup and class loading<br />
set_include_path(&#8216;.&#8217; . PATH_SEPARATOR . &#8216;../library/&#8217;<br />
    . PATH_SEPARATOR . &#8216;/var/application/models&#8217;<br />
    . PATH_SEPARATOR . get_include_path());<br />
include &#8220;Zend/Loader.php&#8221;;<br />
Zend_Loader::registerAutoload();  //everthing after this point seems to be the same as what you have</p>
<p>// set up databases</p>
<p>include &#8220;App_Db_Table_Abstract.php&#8221;;<br />
$databases = new Zend_Config_Ini(&#8216;/var/application/config.ini&#8217;, &#8216;databases&#8217;);<br />
$dbAdapters = array();<br />
 foreach($databases-&gt;db as $config_name =&gt; $db)<br />
    {<br />
    $dbAdapters[$config_name] = Zend_Db::factory($db-&gt;adapter,$db-&gt;config-&gt;toArray());<br />
    if((boolean)$db-&gt;default)<br />
        {<br />
        Zend_Db_Table::setDefaultAdapter($dbAdapters[$config_name]);<br />
        }<br />
    }<br />
 Zend_Registry::set(&#8216;dbAdapters&#8217;,$dbAdapters);</p>
<p>// setup controller<br />
$frontController = Zend_Controller_Front::getInstance();<br />
//change to false before the &#8220;unveiling&#8221;<br />
$frontController-&gt;throwExceptions(true);<br />
$frontController-&gt;setControllerDirectory(&#8216;/var/application/controllers&#8217;);<br />
Zend_Layout::startMvc(array(&#8216;layoutPath&#8217;=&gt;&#8217;/var/application/layouts&#8217;));</p>
<p>// run!<br />
$frontController-&gt;dispatch();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry Eitel</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-269</link>
		<dc:creator>Larry Eitel</dc:creator>
		<pubDate>Mon, 21 Jul 2008 14:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-269</guid>
		<description>Awesome. Thank you :)</description>
		<content:encoded><![CDATA[<p>Awesome. Thank you :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaybill McCarthy</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-268</link>
		<dc:creator>Jaybill McCarthy</dc:creator>
		<pubDate>Tue, 15 Jul 2008 17:52:07 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-268</guid>
		<description>@monk.e.boy - Thanks for the response! Having multiple tables with the same name in different databases shouldn&#039;t be an issue at all - you&#039;d just give them different class names.  

As for your other assertion, I&#039;m not sure why you&#039;d want controllers to know anything about the databases - that pretty much violates the MVC pattern.</description>
		<content:encoded><![CDATA[<p>@monk.e.boy &#8211; Thanks for the response! Having multiple tables with the same name in different databases shouldn&#8217;t be an issue at all &#8211; you&#8217;d just give them different class names.  </p>
<p>As for your other assertion, I&#8217;m not sure why you&#8217;d want controllers to know anything about the databases &#8211; that pretty much violates the MVC pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: monk.e.boy</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-267</link>
		<dc:creator>monk.e.boy</dc:creator>
		<pubDate>Fri, 11 Jul 2008 14:50:06 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-267</guid>
		<description>App_Db_Table_Abstract this name is a bit confusing, you&#039;d assume (from the ZF naming convention) that it is found in app/db/table/abstract.php

What happens if you have 2 DBs both with a &#039;foo&#039; table? Do you put your models in app/model/db/foo.php ?

In my app I read the ini file/db section in the controller class. This means each different controller can access a different database. But your way is an interesting approach.

monk.e.boy</description>
		<content:encoded><![CDATA[<p>App_Db_Table_Abstract this name is a bit confusing, you&#8217;d assume (from the ZF naming convention) that it is found in app/db/table/abstract.php</p>
<p>What happens if you have 2 DBs both with a &#8216;foo&#8217; table? Do you put your models in app/model/db/foo.php ?</p>
<p>In my app I read the ini file/db section in the controller class. This means each different controller can access a different database. But your way is an interesting approach.</p>
<p>monk.e.boy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-249</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Tue, 17 Jun 2008 12:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-249</guid>
		<description>great!

thanks!

:D</description>
		<content:encoded><![CDATA[<p>great!</p>
<p>thanks!</p>
<p>:D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-244</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 03 Jun 2008 10:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-244</guid>
		<description>Excellent article, solved my multi database problems immediately, thanks a lot :)</description>
		<content:encoded><![CDATA[<p>Excellent article, solved my multi database problems immediately, thanks a lot :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eko</title>
		<link>http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/comment-page-1/#comment-229</link>
		<dc:creator>eko</dc:creator>
		<pubDate>Fri, 04 Apr 2008 06:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/#comment-229</guid>
		<description>dear sir, 
i&#039;m is student from indonesia and i&#039;m beginer in php, i try to study zf.
i have question, how to connect 2 db with zf, for example Ms. SQL server (main db) and MySQL (2nd db).
i use ms. sql to get master data, and i save it to mysql.

thx&#039;s f u help
and sorry my english is to bad.</description>
		<content:encoded><![CDATA[<p>dear sir,<br />
i&#8217;m is student from indonesia and i&#8217;m beginer in php, i try to study zf.<br />
i have question, how to connect 2 db with zf, for example Ms. SQL server (main db) and MySQL (2nd db).<br />
i use ms. sql to get master data, and i save it to mysql.</p>
<p>thx&#8217;s f u help<br />
and sorry my english is to bad.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
