<?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>Radu Dinca</title>
	<atom:link href="http://www.dincaradu.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dincaradu.com</link>
	<description>Just another boring blog... mine!!!! :D</description>
	<lastBuildDate>Sat, 25 May 2013 20:27:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Just another awesome remix</title>
		<link>http://www.dincaradu.com/2013/05/25/just-another-awesome-remix/</link>
		<comments>http://www.dincaradu.com/2013/05/25/just-another-awesome-remix/#comments</comments>
		<pubDate>Sat, 25 May 2013 20:26:04 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[8tracks]]></category>
		<category><![CDATA[Bright Lights]]></category>
		<category><![CDATA[Follow you down]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[playlist]]></category>
		<category><![CDATA[ZEDD]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=154</guid>
		<description><![CDATA[Got bored of the playlist that was playing on 8tracks and started browsing a bit. Suddenly I bumped into this song. Sounds interesting and I felt like sharing. I actually found it in this playlist. http://8tracks.com/jthorp19/fuckuallthetime ENJOY!]]></description>
				<content:encoded><![CDATA[<p>Got bored of the playlist that was playing on 8tracks and started browsing a bit.</p>
<p>Suddenly I bumped into this song. Sounds interesting and I felt like sharing.</p>
<p>I actually found it in this playlist. <a href="http://8tracks.com/jthorp19/fuckuallthetime" title="FuckUAllTheTime 8tracks mix" target="_blank">http://8tracks.com/jthorp19/fuckuallthetime</a></p>
<p>ENJOY!</p>
<div class="tracks-div"><iframe class="tracks-iframe" src="http://8tracks.com/mixes/1585316/player_v3_universal?platform=wordpress" width="595" height="288" style="border: 0px none;"></iframe></div>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/25/just-another-awesome-remix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m gonna do NOTHING today</title>
		<link>http://www.dincaradu.com/2013/05/25/im-gonna-do-nothing-today/</link>
		<comments>http://www.dincaradu.com/2013/05/25/im-gonna-do-nothing-today/#comments</comments>
		<pubDate>Sat, 25 May 2013 13:26:04 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[feet out]]></category>
		<category><![CDATA[in bed]]></category>
		<category><![CDATA[lazy mode engaged]]></category>
		<category><![CDATA[saturday]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=142</guid>
		<description><![CDATA[To be completely honest with you, today I&#8217;m no mood for doing creative stuff. In the last few days I finished a small personal project of which I&#8217;m very proud. After I finish writing the documentation, texts on the site and get a domain name I&#8217;m gonna make a proper article on it, but for now if you&#8217;re curious to check it out go to dev.dincaradu.com/expenses/. So&#8230; as I was saying. I want to be lazy today. Why not? I deserve it. Worked hard all week. While I was staring at my display which had a browser with an youtube page showing, a video thumbnail caught my eye and I said to myself &#8220;I have to see this!&#8221;. So this is how I discovered the video above (Riding Solo dir. by Aris Jerome) and came up with the idea of this article. Let me find a picture that would best [...]]]></description>
				<content:encoded><![CDATA[<p>To be completely honest with you, today I&#8217;m no mood for doing creative stuff.</p>
<p>In the last few days I finished a small personal project of which I&#8217;m very proud. After I finish writing the documentation, texts on the site and get a domain name I&#8217;m gonna make a proper article on it, but for now if you&#8217;re curious to check it out go to <a href="http://dev.dincaradu.com/expenses/" title="Expenses - A great wallet simulator" target="_blank">dev.dincaradu.com/expenses/</a>.</p>
<p>So&#8230; as I was saying. I want to be lazy today. Why not? I deserve it. Worked hard all week. While I was staring at my display which had a browser with an youtube page showing, a video thumbnail caught my eye and I said to myself &#8220;I have to see this!&#8221;. So this is how I discovered the video above (<a href="https://www.youtube.com/watch?v=XEYJHWuK9_Q" title="Riding Solo dir. by Aris Jerome" target="_blank">Riding Solo dir. by Aris Jerome</a>) and came up with the idea of this article.</p>
<p>Let me find a picture that would best describe my mood today.</p>
<p>&#8230;<br />
5 minutes later<br />
&#8230;</p>
<p>Pfff.. got bored of looking&#8230; everybody watermarks their photos. Why? WHY? <strong>WHY??!??!!</strong> </p>
<p><a href="http://www.dincaradu.com/wordpress/wp-content/uploads/2013/05/EDD038839D188DE678CBC9D66B39AB_h316_w628_m5_cywxFfCIB.jpg"><img src="http://www.dincaradu.com/wordpress/wp-content/uploads/2013/05/EDD038839D188DE678CBC9D66B39AB_h316_w628_m5_cywxFfCIB.jpg" alt="I could/should spend a couple of days in bed" width="595" class="aligncenter size-full wp-image-143" /></a></p>
<p>I found this one but it barely begins to describe how I imagine myself after I post this.</p>
<p>&#8220;<strong>Lazy mode engaged</strong>&#8221; <em>as my girlfriend would say</em>.</p>
<p>Some other funny photos I found while browsing:</p>

<a href='http://www.dincaradu.com/2013/05/25/im-gonna-do-nothing-today/1125-feet-sex-bed-couple_sm/' title='1125-feet-sex-bed-couple_sm'><img width="150" height="150" src="http://www.dincaradu.com/wordpress/wp-content/uploads/2013/05/1125-feet-sex-bed-couple_sm-150x150.jpg" class="attachment-thumbnail" alt="1125-feet-sex-bed-couple_sm" /></a>
<a href='http://www.dincaradu.com/2013/05/25/im-gonna-do-nothing-today/foot/' title='foot'><img width="150" height="150" src="http://www.dincaradu.com/wordpress/wp-content/uploads/2013/05/feet-in-bed-150x150.jpg" class="attachment-thumbnail" alt="foot" /></a>

<p>Yeah&#8230; pretty much done. Not that good of a writer/blogger, ha?</p>
<p>See you this time tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/25/im-gonna-do-nothing-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly cycle</title>
		<link>http://www.dincaradu.com/2013/05/23/weekly-cycle/</link>
		<comments>http://www.dincaradu.com/2013/05/23/weekly-cycle/#comments</comments>
		<pubDate>Thu, 23 May 2013 19:40:04 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=138</guid>
		<description><![CDATA[So freakin&#8217; true!]]></description>
				<content:encoded><![CDATA[<p>So freakin&#8217; true!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/23/weekly-cycle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force PHP to show all errors and warnings</title>
		<link>http://www.dincaradu.com/2013/05/23/force-php-to-show-all-errors-and-warnings/</link>
		<comments>http://www.dincaradu.com/2013/05/23/force-php-to-show-all-errors-and-warnings/#comments</comments>
		<pubDate>Thu, 23 May 2013 10:28:05 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[<code> ... </code>]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[error reporting]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=136</guid>
		<description><![CDATA[If you don&#8217;t have access to php.ini or no .htaccess file you can copy and paste the 2 lines of code below at the beginning of the PHP file you want to show the errors on. // Make PHP show all errors error_reporting(E_ALL); ini_set('display_errors','On');]]></description>
				<content:encoded><![CDATA[<p>If you don&#8217;t have access to php.ini or no .htaccess file you can copy and paste the 2 lines of code below at the beginning of the PHP file you want to show the errors on.</p>
<p><code><br />
// Make PHP show all errors<br />
error_reporting(E_ALL);<br />
ini_set('display_errors','On');<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/23/force-php-to-show-all-errors-and-warnings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reclama videochat :)))))</title>
		<link>http://www.dincaradu.com/2013/05/22/reclama-videochat/</link>
		<comments>http://www.dincaradu.com/2013/05/22/reclama-videochat/#comments</comments>
		<pubDate>Wed, 22 May 2013 08:27:42 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Cause it's fun]]></category>
		<category><![CDATA[commercial]]></category>
		<category><![CDATA[igrasie]]></category>
		<category><![CDATA[videochat]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=134</guid>
		<description><![CDATA[Ce tare e reclama!]]></description>
				<content:encoded><![CDATA[<p>Ce tare e reclama!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/22/reclama-videochat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My new Samsung S22B300H &#8211; LED monitor &#8211; 21.5&#8243;</title>
		<link>http://www.dincaradu.com/2013/05/15/my-new-samsung-s22b300h-led-monitor-21-5/</link>
		<comments>http://www.dincaradu.com/2013/05/15/my-new-samsung-s22b300h-led-monitor-21-5/#comments</comments>
		<pubDate>Wed, 15 May 2013 23:37:30 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[22"]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[eMag]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[Samsung]]></category>
		<category><![CDATA[shopping]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=125</guid>
		<description><![CDATA[Today I went and bought a brand new display to change my old 19&#8243; Philips. The new display is an awesome 22&#8243; Samsung LED display with shit loads of predefined settings and modes for color, contrast, luminosity and so on. Also is nice about this display that it doesn&#8217;t have light spots, like on LED displays from the same class on which you can notice where are positioned the LEDs used to illuminate the display. But enough with the boring chit-chat, let me show you some specs for this Samsung S22B300H &#8211; LED monitor &#8211; 21.5&#8243;. Basic Specifications Manufacturer&#8217;s Part Number LS22B300HS/EN Product Description Samsung S22B300H &#8211; LED monitor &#8211; 21.5&#8243; Colour Black, high gloss Weight 3 kg Dimensions (WxDxH) 51.2 cm x 19.7 cm x 38.5 cm &#8211; with stand Environmental Standards ENERGY STAR Qualified , EPEAT Gold Device Type LED-backlit LCD monitor &#8211; 21.5&#8243; Native Resolution 1920 x [...]]]></description>
				<content:encoded><![CDATA[<p>Today I went and bought <a href="http://profitshare.emag.ro/click.php?ad_client=2620c190bbe9863052a58a71b3331ea0&amp;add_id=295954&amp;redirect=monitor-led-samsung-21-5-wide-full-hd-hdmi-negru-lucios-s22b300h%2Fpd%2FE4X9TBBBM%2F">a brand new display</a><img style="border: none !important; margin: 0px !important;" alt="" src="http://profitshare.emag.ro/link_track.php?ad_client=2620c190bbe9863052a58a71b3331ea0&amp;add_id=295954" width="1" height="1" border="0" /> to change my old 19&#8243; Philips.</p>
<p>The new display is <a href="http://profitshare.emag.ro/click.php?ad_client=2620c190bbe9863052a58a71b3331ea0&amp;add_id=295954&amp;redirect=monitor-led-samsung-21-5-wide-full-hd-hdmi-negru-lucios-s22b300h%2Fpd%2FE4X9TBBBM%2F">an awesome 22&#8243; Samsung LED display</a> with shit loads of predefined settings and modes for color, contrast, luminosity and so on. Also is nice about this display that it doesn&#8217;t have light spots, like on LED displays from the same class on which you can notice where are positioned the LEDs used to illuminate the display.</p>
<p>But enough with the boring chit-chat, let me show you some specs for this <a href="http://profitshare.emag.ro/click.php?ad_client=2620c190bbe9863052a58a71b3331ea0&amp;add_id=295954&amp;redirect=monitor-led-samsung-21-5-wide-full-hd-hdmi-negru-lucios-s22b300h%2Fpd%2FE4X9TBBBM%2F">Samsung S22B300H &#8211; LED monitor &#8211; 21.5&#8243;</a>.</p>
<table cellspacing="0">
<tbody>
<tr>
<th colspan="2">Basic Specifications</th>
</tr>
<tr>
<th>Manufacturer&#8217;s Part Number</th>
<td>LS22B300HS/EN</td>
</tr>
<tr>
<th>Product Description</th>
<td>Samsung S22B300H &#8211; LED monitor &#8211; 21.5&#8243;</td>
</tr>
<tr>
<th>Colour</th>
<td>Black, high gloss</td>
</tr>
<tr>
<th>Weight</th>
<td>3 kg</td>
</tr>
<tr>
<th>Dimensions (WxDxH)</th>
<td>51.2 cm x 19.7 cm x 38.5 cm &#8211; with stand</td>
</tr>
<tr>
<th>Environmental Standards</th>
<td>ENERGY STAR Qualified , EPEAT Gold</td>
</tr>
<tr>
<th>Device Type</th>
<td>LED-backlit LCD monitor &#8211; 21.5&#8243;</td>
</tr>
<tr>
<th>Native Resolution</th>
<td>1920 x 1080</td>
</tr>
<tr>
<th>Response Time</th>
<td>5 ms</td>
</tr>
<tr>
<th>Colour Support</th>
<td>16.7 million colours</td>
</tr>
<tr>
<th>Brightness</th>
<td>250 cd/m2</td>
</tr>
<tr>
<th>Contrast Ratio</th>
<td>1000:1 / 5000000:1 (dynamic)</td>
</tr>
<tr>
<th>Input Connectors</th>
<td>HDMI, VGA</td>
</tr>
<tr>
<th>Aspect Ratio</th>
<td>Widescreen &#8211; 16:9</td>
</tr>
<tr>
<th>Display Position Adjustments</th>
<td>Tilt</td>
</tr>
<tr>
<th>Microsoft Certification</th>
<td>Compatible with Windows 7</td>
</tr>
<tr>
<th colspan="2">General</th>
</tr>
<tr>
<th>Display Type</th>
<td>LED-backlit LCD monitor / TFT active matrix</td>
</tr>
<tr>
<th>Diagonal Size</th>
<td>21.5&#8243;</td>
</tr>
<tr>
<th>Aspect Ratio</th>
<td>Widescreen &#8211; 16:9</td>
</tr>
<tr>
<th>Native Resolution</th>
<td>1920 x 1080</td>
</tr>
<tr>
<th>Brightness</th>
<td>250 cd/m2</td>
</tr>
<tr>
<th>Contrast Ratio</th>
<td>1000:1 / 5000000:1 (dynamic)</td>
</tr>
<tr>
<th>Colour Support</th>
<td>16.7 million colours</td>
</tr>
<tr>
<th>Response Time</th>
<td>5 ms</td>
</tr>
<tr>
<th>Horizontal Viewing Angle</th>
<td>170</td>
</tr>
<tr>
<th>Vertical Viewing Angle</th>
<td>160</td>
</tr>
<tr>
<th>Backlight Technology</th>
<td>LED backlight</td>
</tr>
<tr>
<th>Features</th>
<td>Power off timer, MagicTune, MagicColor, MagicAngle, MagicBright 3, Mega Dynamic Contrast Ratio</td>
</tr>
<tr>
<th>Colour</th>
<td>Black, high gloss</td>
</tr>
<tr>
<th>Dimensions (WxDxH)</th>
<td>51.2 cm x 19.7 cm x 38.5 cm &#8211; with stand</td>
</tr>
<tr>
<th>Weight</th>
<td>3 kg</td>
</tr>
<tr>
<th colspan="2">Dimensions &amp; Weight</th>
</tr>
<tr>
<th>Dimensions &amp; Weight Details</th>
<td>With stand &#8211; 51.2 cm x 19.7 cm x 38.5 cm x 3 kg ¦ Without stand &#8211; 51.2 cm x 5.3 cm x 31.1 cm x 2.7 kg</td>
</tr>
<tr>
<th colspan="2">Miscellaneous</th>
</tr>
<tr>
<th>Cables Included</th>
<td>VGA cable</td>
</tr>
<tr>
<th>Compatible with Windows 7</th>
<td>&#8220;Compatible with Windows 7&#8243; software and devices carry Microsoft’s assurance that these products have passed tests for compatibility and reliability with 32-bit and 64-bit Windows 7.</td>
</tr>
<tr>
<th colspan="2">Environmental Standards</th>
</tr>
<tr>
<th>EPEAT Compliant</th>
<td>EPEAT Gold</td>
</tr>
<tr>
<th>ENERGY STAR Qualified</th>
<td>Yes</td>
</tr>
<tr>
<th colspan="2">Power</th>
</tr>
<tr>
<th>Power Supply</th>
<td>External</td>
</tr>
<tr>
<th>Voltage Required</th>
<td>AC 120/230 V ( 50/60 Hz )</td>
</tr>
<tr>
<th>Power Consumption Operational</th>
<td>30 Watt</td>
</tr>
<tr>
<th>Power Consumption Stand by / Sleep</th>
<td>0.3 Watt</td>
</tr>
<tr>
<th colspan="2">Connectivity</th>
</tr>
<tr>
<th>Interfaces</th>
<td>VGA ¦ HDMI</td>
</tr>
<tr>
<th colspan="2">Mechanical</th>
</tr>
<tr>
<th>Display Position Adjustments</th>
<td>Tilt</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/15/my-new-samsung-s22b300h-led-monitor-21-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dude, I&#8217;m joking!</title>
		<link>http://www.dincaradu.com/2013/05/15/dude-im-joking/</link>
		<comments>http://www.dincaradu.com/2013/05/15/dude-im-joking/#comments</comments>
		<pubDate>Wed, 15 May 2013 23:22:46 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Cause it's fun]]></category>
		<category><![CDATA[babies]]></category>
		<category><![CDATA[caption pic]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[meme]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=122</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/15/dude-im-joking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disclosure &#8211; Latch Feat. Sam Smith (Unofficial video)</title>
		<link>http://www.dincaradu.com/2013/05/12/disclosure-latch-feat-sam-smith-unofficial-video/</link>
		<comments>http://www.dincaradu.com/2013/05/12/disclosure-latch-feat-sam-smith-unofficial-video/#comments</comments>
		<pubDate>Sun, 12 May 2013 11:08:15 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[birthday]]></category>
		<category><![CDATA[Disclosure]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[sexy]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=105</guid>
		<description><![CDATA[It&#8217;s my birthday so I&#8217;m planning to act lazy in bed all day, listening to music and stuff&#8230; So given my plans for today, I discovered a sexy new song. Disclosure &#8211; Latch Feat. Sam Smith (Unofficial video) is the name of the song, as seen on youtube.com. Recommend to watch it, it&#8217;s awesomely sexy!]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s my birthday so I&#8217;m planning to act lazy in bed all day, listening to music and stuff&#8230;<br />
So given my plans for today, I discovered a sexy new song. Disclosure &#8211; Latch Feat. Sam Smith (Unofficial video) is the name of the song, as seen on youtube.com.</p>
<p>Recommend to watch it, it&#8217;s awesomely sexy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/12/disclosure-latch-feat-sam-smith-unofficial-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tavi POPPING his ear</title>
		<link>http://www.dincaradu.com/2013/05/09/tavi-popping-his-ear/</link>
		<comments>http://www.dincaradu.com/2013/05/09/tavi-popping-his-ear/#comments</comments>
		<pubDate>Thu, 09 May 2013 17:30:11 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[Cause it's fun]]></category>
		<category><![CDATA[Tavi]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=102</guid>
		<description><![CDATA[A video of an idiot (idiot &#8211; but not in a bad way) friend of mine POPPING! his ear. Enjoy!]]></description>
				<content:encoded><![CDATA[<p>A video of an idiot (idiot &#8211; but not in a bad way) friend of mine POPPING! his ear.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/09/tavi-popping-his-ear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: MySQL Database connection object</title>
		<link>http://www.dincaradu.com/2013/05/07/mysql-database-connection-object/</link>
		<comments>http://www.dincaradu.com/2013/05/07/mysql-database-connection-object/#comments</comments>
		<pubDate>Tue, 07 May 2013 22:00:02 +0000</pubDate>
		<dc:creator>Radu</dc:creator>
				<category><![CDATA[<code> ... </code>]]></category>

		<guid isPermaLink="false">http://www.dincaradu.com/?p=89</guid>
		<description><![CDATA[Recently I started working on a project and I&#8217;m developing an object for connecting and dealing with the database; I&#8217;m going to post what I&#8217;ve written so far and hope you are willing to provide feedback on what&#8217;s missing, what needs improvement and so on. The source code available down the page.]]></description>
				<content:encoded><![CDATA[<p>Recently I started working on a project and I&#8217;m developing an object for connecting and dealing with the database;</p>
<p>I&#8217;m going to post what I&#8217;ve written so far and hope you are willing to provide feedback on what&#8217;s missing, what needs improvement and so on.</p>
<p>The source code available down the page.</p>
<p><code><br />
<?<br />
/*<br />
 * Error Messages<br />
 *<br />
 * #1 - mysql_connect error<br />
 * #2 - mysql_select_db error<br />
 * #3 - mysql_query insert error<br />
 * #4 - mysql_query update error<br />
 */<br />
<br />
class db_mysql {<br />
    // This one helps us connect to the db<br />
    function connect() {<br />
        global $dbhost;<br />
        global $dbpass;<br />
        global $dbuser;<br />
<br />
        $dblink = mysql_connect($dbhost, $dbuser, $dbpass) or die("DB MYSQL #1: Couldn't connect to database with given credentials! (" . mysql_error($dblink) . ")");<br />
<br />
        $this->select_db($dblink);<br />
<br />
        return $dblink;<br />
    }<br />
    // This one selects the desired db<br />
    function select_db($dblink) {<br />
        global $dbname;<br />
<br />
        mysql_select_db($dbname, $dblink) or die("DB MYSQL #2: Couldn't select the desired database. (" . mysql_error($dblink) . ")");<br />
<br />
        return true;<br />
    }<br />
    // This one executes an insert query<br />
    function insert($query_to_run, $dblink) {<br />
        $query_to_run = "INSERT INTO " . $query_to_run;<br />
<br />
        if (mysql_query($query_to_run, $dblink) or die("DB MYSQL #3: Couldn't insert data into db. (" . $query_to_run . ")")) {<br />
            return true;<br />
        } else {<br />
            return false;<br />
        }<br />
    }<br />
    function update($dblink, $table = NULL, $what_to_update = NULL, $filters = NULL) {<br />
        if ($table != NULL &#038;&#038; $what_to_update != NULL &#038;&#038; is_array($what_to_update)) {<br />
            $sql_query = "UPDATE `" . $table . "` SET";<br />
<br />
            foreach ($what_to_update as $field => $value) {<br />
                if (is_int($value)) {<br />
                    $sql_query .= " `" . $field . "` = " . $value . ",";<br />
                } elseif (is_string($value)) {<br />
                    $sql_query .= " `" . $field . "` = '" . $value . "',";<br />
                }<br />
            }<br />
<br />
            $sql_query = substr($sql_query, 0, -1);<br />
<br />
            if ($filters != NULL) {<br />
                $sql_query .= " WHERE " . $filters;<br />
            }<br />
<br />
            if (mysql_query($sql_query, $dblink) or die("DB MYSQL #4: Couldn't update requested data. (" . $sql_query . ")")) {<br />
                return true;<br />
            } else {<br />
                return false;<br />
            }<br />
        }<br />
    }<br />
    function request($dblink, $tables = NULL, $fields = NULL, $filters = NULL, $order = NULL, $limit = NULL) {<br />
        if ($tables != NULL) {<br />
            $sql_query = "SELECT ";<br />
<br />
            if (is_array($fields) &#038;&#038; $fields != NULL) {<br />
                foreach ($fields as $field) {<br />
                    $sql_query .= "`" . $field . "`,";<br />
                }<br />
<br />
                $sql_query = substr($sql_query, 0, -1);<br />
            } elseif (!is_array($fields) &#038;&#038; $fields != NULL) {<br />
                $sql_query .= "`" . $fields . "`";<br />
            } elseif ($fields == NULL) {<br />
                $sql_query .= "*";<br />
            }<br />
<br />
            $sql_query .= " FROM ";<br />
<br />
            if (is_array($tables)) {<br />
                foreach ($tables as $table) {<br />
                    $sql_query .= "`" . $table . "`,";<br />
                }<br />
<br />
                $sql_query = substr($sql_query, 0, -1);<br />
            } else {<br />
                $sql_query .= "`" . $tables . "`";<br />
            }<br />
<br />
            if ($filters != NULL) {<br />
                $sql_query .= " WHERE " . $filters;<br />
            }<br />
<br />
            if ($order != NULL) {<br />
                $sql_query .= " ORDER BY " . $order;<br />
            }<br />
<br />
            if ($limit != NULL) {<br />
                $sql_query .= " LIMIT " . $limit;<br />
            }<br />
<br />
            $query = mysql_query($sql_query, $dblink) or die("DB MYSQL #5: Couldn't get requested data. (" . $sql_query . ")");<br />
<br />
            if ($limit <> 1) {<br />
                $return = array();<br />
            } else {<br />
                $return = "";<br />
            }<br />
<br />
            while ($results = mysql_fetch_array($query)) {<br />
                if ($limit <> 1) {<br />
                    $return[] = $results;<br />
                } else {<br />
                    return $results;<br />
                }<br />
            }<br />
<br />
            return $return;<br />
        }<br />
    }<br />
    function delete($dblink, $tables = NULL, $filters = NULL, $limit = NULL) {<br />
        if ($tables != NULL) {<br />
            $sql_query = "DELETE FROM `" . $tables . "`";<br />
<br />
            if ($filters != NULL) {<br />
                $sql_query .= " WHERE " . $filters;<br />
            }<br />
<br />
            if ($limit != NULL) {<br />
                $sql_query .= " LIMIT " . $limit;<br />
            }<br />
<br />
            if (mysql_query($sql_query, $dblink)) {<br />
                return true;<br />
            } else {<br />
                return false;<br />
            }<br />
        }<br />
    }<br />
    // This one disconnects us from the the db<br />
    function disconnect($dblink) {<br />
        mysql_close($dblink) or die("DB MYSQL #6: Couldn't close db. (" . $sql_query . ")");<br />
<br />
        return true;<br />
    }<br />
}<br />
?><br />
</code></p>
<p><a href="http://dev.dincaradu.com/source-code/db_mysql.7z" title="PHP: MySQL Database connection object">Download the source code here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dincaradu.com/2013/05/07/mysql-database-connection-object/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
