<?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: Writing a Php5 MVC Framework like Code Igniter Part2: Model,Database(pdo),Exceptions and Errors,Helpers</title>
	<atom:link href="http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/feed/" rel="self" type="application/rss+xml" />
	<link>http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/</link>
	<description>Ersin Güvenç's Php Development Blog (Turkey)</description>
	<lastBuildDate>Tue, 17 Apr 2012 13:03:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: admin</title>
		<link>http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/comment-page-1/#comment-4765</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 17 Jan 2012 10:47:25 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=171#comment-4765</guid>
		<description>Usage
$db[&#039;default&#039;] = array(
     &#039;hostname&#039; =&gt; &#039;localhost&#039;,
     &#039;username&#039; =&gt; &#039;root&#039;,
     &#039;password&#039; =&gt; &#039;&#039;,
     &#039;database&#039; =&gt; &#039;test_db&#039;,
     &#039;dbdriver&#039; =&gt; &#039;mysql&#039;,
     &#039;dbh_port&#039; =&gt; &#039;&#039;,
     &#039;char_set&#039; =&gt; &#039;utf8&#039;,
     &#039;options&#039;  =&gt; array( PDO::ATTR_PERSISTENT =&gt; TRUE )
 );                                

 loader::database($db);

add below the codes to your database function
&lt;code&gt;
function database($config = array())
{
   if(is_array($config))
   {
      $db = OB_DBFactory::Connect($config);

      return $db;
    }
}

add below the codes to your OB_DBFactory class Connect function.

if( ! is_array($db))
{
   require_once(APP.&#039;config/database&#039;.EXT);
}

....
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Usage<br />
$db['default'] = array(<br />
     &#8216;hostname&#8217; => &#8216;localhost&#8217;,<br />
     &#8216;username&#8217; => &#8216;root&#8217;,<br />
     &#8216;password&#8217; => &#8221;,<br />
     &#8216;database&#8217; => &#8216;test_db&#8217;,<br />
     &#8216;dbdriver&#8217; => &#8216;mysql&#8217;,<br />
     &#8216;dbh_port&#8217; => &#8221;,<br />
     &#8216;char_set&#8217; => &#8216;utf8&#8242;,<br />
     &#8216;options&#8217;  => array( PDO::ATTR_PERSISTENT => TRUE )<br />
 );                                </p>
<p> loader::database($db);</p>
<p>add below the codes to your database function<br />
<code><br />
function database($config = array())<br />
{<br />
   if(is_array($config))<br />
   {<br />
      $db = OB_DBFactory::Connect($config);</p>
<p>      return $db;<br />
    }<br />
}</p>
<p>add below the codes to your OB_DBFactory class Connect function.</p>
<p>if( ! is_array($db))<br />
{<br />
   require_once(APP.'config/database'.EXT);<br />
}</p>
<p>....<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eder</title>
		<link>http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/comment-page-1/#comment-4758</link>
		<dc:creator>Eder</dc:creator>
		<pubDate>Mon, 16 Jan 2012 18:58:16 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=171#comment-4758</guid>
		<description>Great Work...

I have a problem, my project need a two databases simultaneously, but in actual extruture I dont see possibilities to implementation this.
help me please.</description>
		<content:encoded><![CDATA[<p>Great Work&#8230;</p>
<p>I have a problem, my project need a two databases simultaneously, but in actual extruture I dont see possibilities to implementation this.<br />
help me please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zares</title>
		<link>http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/comment-page-1/#comment-862</link>
		<dc:creator>Zares</dc:creator>
		<pubDate>Wed, 14 Oct 2009 09:24:38 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=171#comment-862</guid>
		<description>Great work!
I observe some weeks of development of this project.
And I think, that this framework is a grand tool for anyone web-developer...</description>
		<content:encoded><![CDATA[<p>Great work!<br />
I observe some weeks of development of this project.<br />
And I think, that this framework is a grand tool for anyone web-developer&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xtc2xl</title>
		<link>http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/comment-page-1/#comment-770</link>
		<dc:creator>xtc2xl</dc:creator>
		<pubDate>Sat, 19 Sep 2009 08:52:30 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=171#comment-770</guid>
		<description>thanks for your quick reply, looking forward to playing around with this (btw remember to change your download.zip if you get the chance)</description>
		<content:encoded><![CDATA[<p>thanks for your quick reply, looking forward to playing around with this (btw remember to change your download.zip if you get the chance)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/comment-page-1/#comment-756</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 18 Sep 2009 23:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=171#comment-756</guid>
		<description>thanks your feedback i didn&#039;t test it under the php 5.3.0
so you need do some changes..

1 - open DB.php change prepare function name as _prepare
2 - open test/model_test.php change all $this-&gt;prepare lines as $this-&gt;_prepare
3 - open DBFactory.php remove completely &#039;mysql&#039; part and add this lines ... 

&lt;code&gt;$dbh = new DB(&quot;mysql:host=$hostname;dbname=$database&quot;,&quot;$username&quot;,&quot;$password&quot;);
$dbh-&gt;query(&#039;SET NAMES utf8&#039;);&lt;/code&gt;

now it works also with 5.3.0</description>
		<content:encoded><![CDATA[<p>thanks your feedback i didn&#8217;t test it under the php 5.3.0<br />
so you need do some changes..</p>
<p>1 &#8211; open DB.php change prepare function name as _prepare<br />
2 &#8211; open test/model_test.php change all $this-&gt;prepare lines as $this-&gt;_prepare<br />
3 &#8211; open DBFactory.php remove completely &#8216;mysql&#8217; part and add this lines &#8230; </p>
<p><code>$dbh = new DB("mysql:host=$hostname;dbname=$database","$username","$password");<br />
$dbh->query('SET NAMES utf8');</code></p>
<p>now it works also with 5.3.0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xtc2xl</title>
		<link>http://develturk.com/2009/09/07/writing-a-php5-mvc-framework-like-code-igniter-part2-model-database-pdo-exceptions-and-errors-helpers/comment-page-1/#comment-754</link>
		<dc:creator>xtc2xl</dc:creator>
		<pubDate>Fri, 18 Sep 2009 20:28:42 +0000</pubDate>
		<guid isPermaLink="false">http://develturk.com/?p=171#comment-754</guid>
		<description>sounds nice but error when running

[Obullo][Strict Error]:Declaration of DB::prepare() should be compatible with that of PDO::prepare()
File:  C:\wamp\www\obullo\base\database\DB.php
Line:  269

Fatal error: Undefined class constant &#039;MYSQL_ATTR_INIT_COMMAND&#039; in C:\wamp\www\obullo\base\database\DBFactory.php on line 73</description>
		<content:encoded><![CDATA[<p>sounds nice but error when running</p>
<p>[Obullo][Strict Error]:Declaration of DB::prepare() should be compatible with that of PDO::prepare()<br />
File:  C:\wamp\www\obullo\base\database\DB.php<br />
Line:  269</p>
<p>Fatal error: Undefined class constant &#8216;MYSQL_ATTR_INIT_COMMAND&#8217; in C:\wamp\www\obullo\base\database\DBFactory.php on line 73</p>
]]></content:encoded>
	</item>
</channel>
</rss>

