<?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>new element designs blog &#187; Web Development</title>
	<atom:link href="http://www.newelementdesigns.com/blog/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.newelementdesigns.com/blog</link>
	<description>web design and development</description>
	<lastBuildDate>Fri, 11 Jun 2010 00:24:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MySQL PDO Class</title>
		<link>http://www.newelementdesigns.com/blog/2010/05/28/mysql-pdo-class/</link>
		<comments>http://www.newelementdesigns.com/blog/2010/05/28/mysql-pdo-class/#comments</comments>
		<pubDate>Fri, 28 May 2010 14:18:35 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.newelementdesigns.com/blog/?p=110</guid>
		<description><![CDATA[PDO provides a good way to connect to different databases in PHP. This code example is for MySQL although I have a version for Oracle as well. If you want the Oracle version just comment and I will send it to you. Read on for the code. class DB{ // database connection variables private $db_user [...]]]></description>
			<content:encoded><![CDATA[<p>PDO provides a good way to connect to different databases in PHP. This code example is for MySQL although I have a version for Oracle as well. If you want the Oracle version just comment and I will send it to you. Read on for the code.</p>
<p><span id="more-110"></span></p>
<pre class="brush:php syntax">
class DB{

// database connection variables
private $db_user = 'USERNAME';
private $db_pass = 'PASSWORD';
private $db_host = 'localhost';

// PDO class var
private $DBH;
// PDO Statement class var
public $STH;

	// The singleton instance
	private static $DB_Instance;

	// Initiate connection to DB
	private function __construct(){

		try {
			// DB Connection
			$this->DBH = new PDO('mysql:host='.$this->db_host, $this->db_user, $this->db_pass);
			//$this->DBH->setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

		} catch(PDOException $e) {
			// DB connection error message
			trigger_error("Could not connect to database: ". $e->getMessage(), E_USER_ERROR);
		}

	}
	public function __desctruct(){
		$this->DBH = null;
	}

	// Start singleton DB instance
	public static function open(){

        if (!self::$DB_Instance){
            self::$DB_Instance = new DB();
        }

        return self::$DB_Instance;
    }

	/* Prepare query SQL statement
	@param mixed $sql
	@return bool
	*/
	public function q($sql){

		if( !($this->STH = $this->DBH->prepare($sql)) ){

			$this->error($this->STH->errorCode(), $this->STH->errorInfo());

		} else {

			return true;	

		}

	}

	/* Bind variables with type
	@param string $bind
	@param mixed $var
	@param string $type
	@param int $len
	@return bool
	*/
	public function bind($bind, $var, $type, $len = null){

		switch ($type)
		{
			case 'STR':
					return $this->STH->bindParam($bind, $var, PDO::PARAM_STR, $len);
				break;

			case 'INT':
					return $this->STH->bindParam($bind, $var, PDO::PARAM_INT, $len);
				break;

			case 'LOB':
					return $this->STH->bindParam($bind, $var, PDO::PARAM_LOB);
				break;
		}

	}

	/* Execute the SQL statement
	@return bool
	*/
	public function run(){

		if(!$this->STH->execute()){
			$this->error($this->STH->errorCode(), $this->STH->errorInfo());
		} else {
			return true;
		}

	}

	/* Email error
	@param array $error
	*/
	private function error($errorCode, $errorInfo){

		$mssg .= 'Code: '.$errorCode."\n\r";
		$mssg .= $errorInfo[0].': '.$errorInfo[1]."\n\r";
		$mssg .= $errorInfo[2]."\n\r";

		mail("youremail@domain.com", "MySQL Error", "$mssg");

	}

} // END class DB

// EXAMPLE USAGE
/*
$DB = DB::open();

// Simple Query
$sql = "SELECT col1, col2 FROM table";
$DB->q($sql);
//$DB->bind(':var', $var, 'STR');
$DB->run();

while($row = $DB->STH->fetch()){

	echo $row['COL1'].' '.$row['COL2'].'';

}
*/
</pre>
<p>This is just a simple connection. I&#8217;m sure it can be improved. If you have any flavor you want to add, comment and I will consider your addition.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newelementdesigns.com/blog/2010/05/28/mysql-pdo-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centrifuge CMS</title>
		<link>http://www.newelementdesigns.com/blog/2010/05/27/centrifuge-cms/</link>
		<comments>http://www.newelementdesigns.com/blog/2010/05/27/centrifuge-cms/#comments</comments>
		<pubDate>Fri, 28 May 2010 01:58:51 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.newelementdesigns.com/blog/?p=108</guid>
		<description><![CDATA[I now have my very own CMS for any new web development. New clients can easily take advantage of Centrifuge. This will give you the ability to manage the content on your website. It&#8217;s primary focus is page content, but includes content management for blogging, events. A more detailed post is coming soon with a [...]]]></description>
			<content:encoded><![CDATA[<p>I now have my very own CMS for any new web development. New clients can easily take advantage of Centrifuge. This will give you the ability to manage the content on your website. It&#8217;s primary focus is page content, but includes content management for blogging, events. A more detailed post is coming soon with a featured list and screen shots.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newelementdesigns.com/blog/2010/05/27/centrifuge-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reward Buck v3.0</title>
		<link>http://www.newelementdesigns.com/blog/2010/05/27/reward-buck-v3-0/</link>
		<comments>http://www.newelementdesigns.com/blog/2010/05/27/reward-buck-v3-0/#comments</comments>
		<pubDate>Fri, 28 May 2010 01:45:36 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.newelementdesigns.com/blog/?p=104</guid>
		<description><![CDATA[The new version of Reward Buck is live. This is the 3rd version of the local gift certificate site. A new addition is the certificate API. This will allow a site owner to sell their own local certificates through Reward Buck&#8217;s API. For more information you can contact them here.]]></description>
			<content:encoded><![CDATA[<p>The new version of Reward Buck is live. This is the 3rd version of the local gift certificate site. A new addition is the certificate API. This will allow a site owner to sell their own local certificates through Reward Buck&#8217;s API. For more information you can contact them <a href="http://www.rewardbuck.com/contact.php">here</a>.</p>
<p><a href="http://www.rewardbuck.com"><img class="alignnone size-medium wp-image-105" title="rb-screenshot_sm" src="http://www.newelementdesigns.com/blog/wp-content/uploads/2010/05/rb-screenshot_sm-300x291.jpg" alt="Reward Buck 3.0" width="300" height="291" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newelementdesigns.com/blog/2010/05/27/reward-buck-v3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Datachambers Site Launch</title>
		<link>http://www.newelementdesigns.com/blog/2010/01/27/datachambers-site-launch/</link>
		<comments>http://www.newelementdesigns.com/blog/2010/01/27/datachambers-site-launch/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 20:54:13 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.newelementdesigns.com/blog/?p=99</guid>
		<description><![CDATA[I recently launched a new site for Datachambers. Data Chambers is a technology and Information Management services company providing Business Continuity services, Electronic online data backup, Hardcopy Records Management and Data Center Solutions. This site is based on WordPress and features some nice jQuery effects. View http://www.datachambers.com]]></description>
			<content:encoded><![CDATA[<p>I recently launched a new site for Datachambers. Data Chambers is a technology and Information Management services company providing Business Continuity services, Electronic online data backup, Hardcopy Records Management and Data Center Solutions.</p>
<p>This site is based on WordPress and features some nice jQuery effects. View <a href="http://www.datachambers.com" target="_blank">http://www.datachambers.com</a></p>
<p><img class="alignnone size-medium wp-image-100" title="DC-Comp-2-4" src="http://www.newelementdesigns.com/blog/wp-content/uploads/2010/01/DC-Comp-2-4-280x300.jpg" alt="" width="280" height="300" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newelementdesigns.com/blog/2010/01/27/datachambers-site-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Long Time, No Updates, Lots Going On&#8230;</title>
		<link>http://www.newelementdesigns.com/blog/2009/06/19/long-time-no-updates/</link>
		<comments>http://www.newelementdesigns.com/blog/2009/06/19/long-time-no-updates/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 19:53:35 +0000</pubDate>
		<dc:creator>Don</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.newelementdesigns.com/blog/?p=92</guid>
		<description><![CDATA[Wow. I&#8217;ve been real busy. It has been a while sine I updated the blog. A few projects going on around here. Walkerfirst.com is going up with a new look. They have introduced an online ordering system for telecom equipment. They are also now offering virtual warehousing for equipment and serial number tracking. Elle Wedding [...]]]></description>
			<content:encoded><![CDATA[<p>Wow. I&#8217;ve been real busy. It has been a while sine I updated the blog. A few projects going on around here.</p>
<p><a title="Walker First" href="http://beta.walkerfirst.com" target="_blank">Walkerfirst.com</a> is going up with a new look. They have introduced an online ordering system for telecom equipment. They are also now offering virtual warehousing for equipment and serial number tracking.</p>
<p><a href="http://beta.walkerfirst.com"><img class="alignnone size-medium wp-image-93" title="Walker and Associates" src="http://www.newelementdesigns.com/blog/wp-content/uploads/2009/06/WF_NEW_homepage-300x263.jpg" alt="Walker and Associates" width="300" height="263" /></a></p>
<p><a title="Elle Wedding Gowns" href="http://elleweddinggowns.com" target="_blank">Elle Wedding Gowns</a> is a site going up soon for people that want to buy or sell used wedding gowns. It will feature a shopping cart with order tracking and a messaging system for those selling their gowns. A consignment option will be available too.</p>
<p><a href="http://elleweddinggowns.com"><img class="alignnone size-medium wp-image-94" title="Elle Wedding Gowns" src="http://www.newelementdesigns.com/blog/wp-content/uploads/2009/06/elle-300x112.jpg" alt="Elle Wedding Gowns" width="300" height="112" /></a></p>
<p>Last but not least is the new Data Chambers site. Work is just beginning and will feature a totally refreshed design based on the ever so popular WordPress engine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newelementdesigns.com/blog/2009/06/19/long-time-no-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
