<?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: Zend Framework 1.5.1 and my Models code</title>
	<atom:link href="http://www.thehuey.com/blog/2008/04/01/zend-framework-151-and-my-models-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thehuey.com/blog/2008/04/01/zend-framework-151-and-my-models-code/</link>
	<description>News and other posts for friends and family</description>
	<lastBuildDate>Tue, 03 Nov 2009 16:50:41 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Harlow</title>
		<link>http://www.thehuey.com/blog/2008/04/01/zend-framework-151-and-my-models-code/comment-page-1/#comment-21860</link>
		<dc:creator>Harlow</dc:creator>
		<pubDate>Tue, 01 Apr 2008 23:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.thehuey.com/blog/archives/43#comment-21860</guid>
		<description>Hey thanks for helping me through this. Heres what I ended up with:

[ Config file: ]
[development] 
db.adapter = &quot;Mysqli&quot; 
db.params.host = &quot;localhost&quot; 
db.params.username = &quot;user&quot; 
db.params.password = &quot;password&quot;
db.params.dbname = &quot;dbname&quot;

[ Bootstrap: ]
# config
$config = new Zend_Config_Ini(APP_PATH.&#039;/config/settings.ini&#039;, &#039;development&#039;);
	
# database 
$db = Zend_Db::factory($config-&gt;db); 
Zend_Db_Table::setDefaultAdapter($db);

[ Then the model: ]
class SomeModelName extends Zend_Db_Table
{
    protected $_name = &#039;db_table_name&#039;;
	
    public function findByPermalink($permalink = &#039;&#039;)
	{
		return $this-&gt;fetchRow($this-&gt;select()-&gt;where(&#039;permalink = ?&#039;, $permalink));
	}
	
}

And viola! thats it. Minimal amount of code and all the DB functionality I need ;)</description>
		<content:encoded><![CDATA[<p>Hey thanks for helping me through this. Heres what I ended up with:</p>
<p>[ Config file: ]<br />
[development]<br />
db.adapter = &#8220;Mysqli&#8221;<br />
db.params.host = &#8220;localhost&#8221;<br />
db.params.username = &#8220;user&#8221;<br />
db.params.password = &#8220;password&#8221;<br />
db.params.dbname = &#8220;dbname&#8221;</p>
<p>[ Bootstrap: ]<br />
# config<br />
$config = new Zend_Config_Ini(APP_PATH.&#8217;/config/settings.ini&#8217;, &#8216;development&#8217;);</p>
<p># database<br />
$db = Zend_Db::factory($config-&gt;db);<br />
Zend_Db_Table::setDefaultAdapter($db);</p>
<p>[ Then the model: ]<br />
class SomeModelName extends Zend_Db_Table<br />
{<br />
    protected $_name = &#8216;db_table_name&#8217;;</p>
<p>    public function findByPermalink($permalink = &#8221;)<br />
	{<br />
		return $this-&gt;fetchRow($this-&gt;select()-&gt;where(&#8217;permalink = ?&#8217;, $permalink));<br />
	}</p>
<p>}</p>
<p>And viola! thats it. Minimal amount of code and all the DB functionality I need <img src='http://www.thehuey.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
