<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PersonalBlog &#187; multiple database</title>
	<atom:link href="http://arimita.web.id/tag/multiple-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://arimita.web.id</link>
	<description>Just another personal weblog</description>
	<lastBuildDate>Mon, 19 Jul 2010 08:31:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Connecting Multiple Database</title>
		<link>http://arimita.web.id/2010/06/connecting-multiple-database/</link>
		<comments>http://arimita.web.id/2010/06/connecting-multiple-database/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 02:57:22 +0000</pubDate>
		<dc:creator>mythworks</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[configuration database]]></category>
		<category><![CDATA[connecting database]]></category>
		<category><![CDATA[multiple database]]></category>
		<category><![CDATA[secondary database]]></category>

		<guid isPermaLink="false">http://arimita.web.id/?p=240</guid>
		<description><![CDATA[If you want to know how to connect to multiple databases in Codeigniter, I’m going to show you.
Step 1:
Open file database.php in the application/config folder.
Step 2:
Find database settings and make a secondary database details in this file. For example:

$db['default']['hostname'] = &#34;localhost&#34;;
$db['default']['username'] = &#34;root&#34;;
$db['default']['password'] = &#34;&#34;;
$db['default']['database'] = &#34;blog&#34;;
$db['default']['dbdriver'] = &#34;mysql&#34;;
$db['default']['dbprefix'] = &#34;&#34;;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to know how to connect to multiple databases in Codeigniter, I’m going to show you.<br />
Step 1:<br />
Open file database.php in the application/config folder.<br />
Step 2:<br />
Find database settings and make a secondary database details in this file. For example:</p>
<pre class="brush: php;">
$db['default']['hostname'] = &quot;localhost&quot;;
$db['default']['username'] = &quot;root&quot;;
$db['default']['password'] = &quot;&quot;;
$db['default']['database'] = &quot;blog&quot;;
$db['default']['dbdriver'] = &quot;mysql&quot;;
$db['default']['dbprefix'] = &quot;&quot;;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = &quot;&quot;;
$db['default']['char_set'] = &quot;utf8&quot;;
$db['default']['dbcollat'] = &quot;utf8_general_ci&quot;;

//And copy and paste listing above like this:

$db['sec_db']['hostname'] = &quot;localhost&quot;;
$db['sec_db']['username'] = &quot;root&quot;;
$db['sec_db']['password'] = &quot;&quot;;
$db['sec_db']['database'] = &quot;blog&quot;;
$db['sec_db']['dbdriver'] = &quot;mysql&quot;;
$db['sec_db']['dbprefix'] = &quot;&quot;;
$db['sec_db']['pconnect'] = TRUE;
$db['sec_db']['db_debug'] = TRUE;
$db['sec_db']['cache_on'] = FALSE;
$db['sec_db']['cachedir'] = &quot;&quot;;
$db['sec_db']['char_set'] = &quot;utf8&quot;;
$db['sec_db']['dbcollat'] = &quot;utf8_general_ci&quot;;
</pre>
<p>As we can see that I have sec_db as secondary database. Don’t forget to change the Controller to load the model and  of course the Model to connect to the sec_db.</p>
]]></content:encoded>
			<wfw:commentRss>http://arimita.web.id/2010/06/connecting-multiple-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

