<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1041947" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1041947</link>
    <description></description>
    <language>en</language>
          <item>
    <title>So the main reason for a DB</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/how-handle-database-access-code#comment-1233663</link>
    <description> &lt;p&gt;So the main reason for a DB abstraction layer is to enable code to be reused (some say it allows you to move to another DB platform easily, but I don&#039;t by into that argument).&lt;/p&gt;
&lt;p&gt;I&#039;m going to stick with functions for now because I don&#039;t like typing $GLOBALS[&#039;db&#039;]-&amp;gt; but maybe I&#039;ll get the hang of it someday &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;.&lt;/p&gt;
 </description>
     <pubDate>Sat, 20 Sep 2008 23:04:01 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1233663 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>The easiest way would</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/how-handle-database-access-code#comment-1233614</link>
    <description> &lt;p&gt;The easiest way would probably just make it a global object.&lt;/p&gt;
&lt;p&gt;Most of the classes and functions that I write don&#039;t have access to the database.  The main reason is why I break up code in classes and objects is so I can use them on other sites.  If you have them use database objects specific to the site, then it will be more difficult to use it elsewhere.  So, get the data from the DB first and send that to the class/function instead of having the class/function fetch the data.&lt;/p&gt;
 </description>
     <pubDate>Fri, 19 Sep 2008 14:16:38 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1233614 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
