<?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>Riot Riot</title>
	<atom:link href="http://riotriot.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://riotriot.net</link>
	<description></description>
	<lastBuildDate>Mon, 22 Feb 2010 00:33:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom:link rel="next" href="http://riotriot.net/feed/?page=2" />

		<item>
		<title>Riot Riot Client Framework</title>
		<link>http://riotriot.net/2010/02/riot-riot-client-framework/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=riot-riot-client-framework</link>
		<comments>http://riotriot.net/2010/02/riot-riot-client-framework/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 01:41:30 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=1026</guid>
		<description><![CDATA[Interwebs, mark today as the beginning of Riot Riot&#8217;s new adventure of using our framework!

Today, we are beginning total development of our framework for any clients that jump on board. Both Phil and I are excited to start implementing any and all features we can imagine to help our clients understand the full scope of [...]]]></description>
			<content:encoded><![CDATA[<p>Interwebs, mark today as the beginning of Riot Riot&#8217;s new adventure of using our framework!</p>
<p><span id="more-1026"></span></p>
<p>Today, we are beginning total development of our framework for any clients that jump on board. Both Phil and I are excited to start implementing any and all features we can imagine to help our clients understand the full scope of work being built. Right now we just wanted to let everyone know that we will be spending spare time between projects further developing our application. Not only will this allow us to come up with fun new ideas but it will strengthen the framework for any clients that might require a lightweight CMS!</p>
<p>Keep an eye for any updates VIA twitter or through our blogs to see any new updates/pictures and content!</p>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/02/riot-riot-client-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple PHP Progress Bar</title>
		<link>http://riotriot.net/2010/02/simple-php-progress-bar/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=simple-php-progress-bar</link>
		<comments>http://riotriot.net/2010/02/simple-php-progress-bar/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 03:55:38 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=1010</guid>
		<description><![CDATA[The other day i was looking to create a simple progress bar for a test application. So this is what i came up with in. Keep in mind this is nothing super intelligent or sophisticated.


Lets start by starting creating the function which will be used to create this progress bar.

1
2
3
4
5
6
7
8
&#60;?php
function progressBar&#40;$percentage&#41; &#123;
	print &#34;&#60;div id=\&#34;progress-bar\&#34; class=\&#34;all-rounded\&#34;&#62;\n&#34;;
	print [...]]]></description>
			<content:encoded><![CDATA[<p>The other day i was looking to create a simple progress bar for a test application. So this is what i came up with in. Keep in mind this is nothing super intelligent or sophisticated.<span id="more-1010"></span></p>
<ol class="listed-steps">
<li>
<p>Lets start by starting creating the function which will be used to create this progress bar.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> progressBar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$percentage</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>progress-bar<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>all-rounded<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>progress-bar-percentage<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>all-rounded<span style="color: #000099; font-weight: bold;">\&quot;</span> style=<span style="color: #000099; font-weight: bold;">\&quot;</span>width: <span style="color: #006699; font-weight: bold;">$percentage</span>%<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percentage</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$percentage</span>%&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>spacer<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&amp;nbsp;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
</li>
<li>
<p>Next lets give the Div&#8217;s some style.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.all-rounded</span> <span style="color: #00AA00;">&#123;</span>
    -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
    -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
    border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.spacer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#progress-bar</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#cccccc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#f2f2f2</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#progress-bar-percentage</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#3063A5</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
 	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFF</span><span style="color: #00AA00;">;</span>
 	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
 	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

</p>
</li>
<li>
<p>Once the CSS has been set, to run this function we just need to throw the function where you want to display it! <strong>Change the number inside the function to display a different percentage value.</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> progressBar<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
</li>
<li>
<p>
Keep in mind you can use some MySQL queries to dynamically change the progress bar. This can be combined with other calculating formula&#8217;s also if you would really want this to be effective.</p>
<p>Navigate to the <a href="/important/downloads/" target="_blank">downloads</a> area to get a working example. All that is required is PHP and some html/css knowledge for the look of the bar.</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/02/simple-php-progress-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Riot Riot in Lake Tahoe</title>
		<link>http://riotriot.net/2010/02/riot-riot-in-lake-tahoe/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=riot-riot-in-lake-tahoe</link>
		<comments>http://riotriot.net/2010/02/riot-riot-in-lake-tahoe/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 20:09:52 +0000</pubDate>
		<dc:creator>Philip</dc:creator>
				<category><![CDATA[Misc.]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Lake Tahoe]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=958</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/02/riot-riot-in-lake-tahoe/" title="Riot Riot in Lake Tahoe"><img src="http://riotriot.net/wordpress/wp-content/uploads/yapb_cache/tahoe.4cgu2bdvizk08wkwgko8owogw.a9sxxja1njksswcs400wcc4cg.th.jpeg" width="180" height="135" alt="Riot Riot in Lake Tahoe" style="float:left;padding:0 10px 10px 0;" ></a>I am currently taking a break from my home office in Los Angeles to travel around the state of California. Monday, I drove up 395 with my friend Chelsea, and am now in Tahoe until the weekend, when I am heading to San Francisco. I am taking some time to work on new designs and [...]]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/02/riot-riot-in-lake-tahoe/" title="Riot Riot in Lake Tahoe"><img src="http://riotriot.net/wordpress/wp-content/uploads/yapb_cache/tahoe.4cgu2bdvizk08wkwgko8owogw.a9sxxja1njksswcs400wcc4cg.th.jpeg" width="180" height="135" alt="Riot Riot in Lake Tahoe" style="float:left;padding:0 10px 10px 0;" ></a><p>I am currently taking a break from my home office in Los Angeles to travel around the state of California.<span id="more-958"></span> Monday, I drove up 395 with my friend Chelsea, and am now in Tahoe until the weekend, when I am heading to San Francisco. I am taking some time to work on new designs and tidy up Riot Riot. Meanwhile, Jonathan is holding down shop in a slushy Massachusetts! Happy winter!</p>
<p>Highlights so far:</p>
<ul>
<li>Alabama Hills</li>
<li>Mt. Whitney (tallest in contiguous U.S.A.)</li>
<li>Mono Lake</li>
<li>Mammoth</li>
<li>Lake Tahoe!!!</li>
</ul>
<p><a href="http://riotriot.net/wordpress/wp-content/uploads/2010/02/IMG_0606.jpg" class="fancybox" rel="395"><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/02/IMG_0606.jpg" width="575" /></a><br />
<a href="http://riotriot.net/wordpress/wp-content/uploads/2010/02/IMG_0630.jpg" class="fancybox" rel="395"><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/02/IMG_0630.jpg" width="575"/></a><br />
<a href="http://riotriot.net/wordpress/wp-content/uploads/2010/02/IMG_0620.jpg" class="fancybox" rel="395"><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/02/IMG_0620.jpg" width="575" /></a><br />
<a href="http://riotriot.net/wordpress/wp-content/uploads/yapb_cache/tahoe.4cgu2bdvizk08wkwgko8owogw.6as5qcllr4sgwoccg8gks0wks.th.jpeg" class="fancybox" rel="395"><img src="http://riotriot.net/wordpress/wp-content/uploads/yapb_cache/tahoe.4cgu2bdvizk08wkwgko8owogw.6as5qcllr4sgwoccg8gks0wks.th.jpeg" width="575" /></a></p>
<p>ps. Sorry for the poor photography. Like all Scheffers, when there is a destination ahead, pictures must be taken whilst moving towards said destination.</p>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/02/riot-riot-in-lake-tahoe/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flickr API and PHP, display images!</title>
		<link>http://riotriot.net/2010/02/flickr-api-and-php-display-images/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=flickr-api-and-php-display-images</link>
		<comments>http://riotriot.net/2010/02/flickr-api-and-php-display-images/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 00:33:13 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Misc.]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=942</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/02/flickr-api-and-php-display-images/" title="Flickr API and PHP, display images!"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=942&amp;w=180" width="1" height="1" alt="Flickr API and PHP, display images!" style="float:left;padding:0 10px 10px 0;" ></a>Flickr in the past couple years has really turned into a great service. PHP too has been a vital item to internet development! Now lets make them play nice together to grab some of your recent images in your flikr account! 


The first step to get this working is to create a Flickr account.


Once your [...]]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/02/flickr-api-and-php-display-images/" title="Flickr API and PHP, display images!"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=942&amp;w=180" width="1" height="1" alt="Flickr API and PHP, display images!" style="float:left;padding:0 10px 10px 0;" ></a><p>Flickr in the past couple years has really turned into a great service. PHP too has been a vital item to internet development! Now lets make them play nice together to grab some of your recent images in your flikr account! <span id="more-942"></span></p>
<ol class="listed-steps">
<li>
<p>The first step to get this working is to create a Flickr account.</p>
</li>
<li>
<p>Once your account is created, get a API. You can do that by clicking this link: <a href="http://www.flickr.com/services/apps/create/apply/" alt="Flickr API">Create a Flickr API</a>. It should be a 32 character (number and letter) random combination. This will be <strong>YOUR</strong> API so keep that somewhere easy to get to.</p>
</li>
<li>
<p>At this point open your favorite development program (for me, CODA or Espresso) and FTP client. <strong>Create the file: <u>flickr.class.php</u> and apply the following code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> flickr <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> flickr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span><span style="color: #000088;">$api_key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$username</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_key</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$api_key</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_id</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">timeout</span>  <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> getUserId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://api.flickr.com/services/rest/?api_key='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;method=flickr.urls.lookupUser&amp;url=http://www.flickr.com/photos/'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$return</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> getImages<span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://api.flickr.com/services/rest/?api_key='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;method=flickr.photos.search&amp;user_id='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUserId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;per_page='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> fetch<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span><span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_NOBODY<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_USERAGENT<span style="color: #339933;">,</span> <span style="color: #0000ff;">'Flickr'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">timeout</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_getinfo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'http_code'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The above code will be complicating if you do not understand <a href="http://www.php.net/manual/en/language.oop5.php" target="_blank">PHP Classes and Functions</a>. Hopefully you do understand enough of the syntax to breakdown some of the code.
</p>
</li>
<li>
<p>Next, enter into a page where you would want to display your photos! This is some example code, make sure your &#8220;flickr.class.php&#8221; require is looking at the correct location. After setting that, <strong>change where it says: &#8220;username&#8221; and &#8220;your-api-key&#8221;.</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'flickr.class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #000088;">$flickr</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> flickr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'username'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'your-api-key'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$images</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$flickr</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getImages</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$images</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Flickr Feed Unavailable'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$images</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photos</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">photo</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$photo</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;http://flickr.com/photos/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$flickr</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;&lt;img src=&quot;http://farm'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">farm</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.static.flickr.com/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">server</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'_'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$photo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">secret</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'_s.jpg&quot; /&gt;&lt;/a&gt; '</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
</li>
<li>
<p>Save your files and then take it for a test drive!</p>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/02/flickr-api-and-php-display-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple: Magic Mouse</title>
		<link>http://riotriot.net/2010/01/apple-magic-mouse/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=apple-magic-mouse</link>
		<comments>http://riotriot.net/2010/01/apple-magic-mouse/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 05:12:28 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[touch]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=824</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/01/apple-magic-mouse/" title="Apple: Magic Mouse"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=824&amp;w=180" width="1" height="1" alt="Apple: Magic Mouse" style="float:left;padding:0 10px 10px 0;" ></a>&#8230; and there was one mouse to rule them all
First Impressions
As always when getting a new item, you just want to get it unwrapped and setup as soon as possible! With Apple&#8217;s new Magic Mouse it does work GREAT with their Macbook Pro series that feature bluetooth! After a quick pairing it was up and [...]]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/01/apple-magic-mouse/" title="Apple: Magic Mouse"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=824&amp;w=180" width="1" height="1" alt="Apple: Magic Mouse" style="float:left;padding:0 10px 10px 0;" ></a><p>&#8230; and there was one mouse to rule them all<span id="more-824"></span></p>
<p><strong>First Impressions</strong><br />
As always when getting a new item, you just want to get it unwrapped and setup as soon as possible! With Apple&#8217;s new Magic Mouse it does work GREAT with their Macbook Pro series that feature bluetooth! After a quick pairing it was up and working!</p>
<p>The design and finish are so far top-notch. With small hands, its neither too large or annoying. Its square profile allows for lots of contact area, and it is very responsive! Its low profile allows for it to keep that wireless sophisticated look. The mouse runs off of AA batteries, which is great since they are widely available.</p>
<p>However, there is one small issue. If you are running &#8220;Snow Leopard&#8221;, you will need to install Apple&#8217;s wireless mouse support. This allows the custom features used in the Magic mouse. Those features are:</p>
<ul>
<li>Scroll with momentum</li>
<li>Two finger navigation</li>
<li>Circle Scrolling</li>
</ul>
<p>You can download Apple&#8217;s wireless mouse software on there site! Click the link below to navigate there: <a href="http://support.apple.com/kb/DL950">http://support.apple.com/kb/DL950</a></p>
<p><img src="http://www.riotriot.net/images/apple-magic-mouse-wrapped.jpg" style="width: 99%; text-align: center;" /></p>
<p>So if there are any available at your local BEST BUY or APPLE store, pick one up! Im sure you will appreciate it! If you want more pictures, please submit a comment and I will get back to you as soon as possible!</p>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/01/apple-magic-mouse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Illustrator: Outlines</title>
		<link>http://riotriot.net/2010/01/random-illustrator-outlines/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=random-illustrator-outlines</link>
		<comments>http://riotriot.net/2010/01/random-illustrator-outlines/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 02:14:12 +0000</pubDate>
		<dc:creator>Philip</dc:creator>
				<category><![CDATA[Design & Development]]></category>
		<category><![CDATA[Misc.]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Drawing]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Illustrator]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=812</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/01/random-illustrator-outlines/" title="Random Illustrator: Outlines"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=812&amp;w=180" width="1" height="1" alt="Random Illustrator: Outlines" style="float:left;padding:0 10px 10px 0;" ></a>The Pen Tool is quickly becoming my favorite Weapon of Choice. Today I doodled up a photo of myself that we might use for our &#8220;Who We Are&#8221; section. If you decide to create a neat traced image, take your time, and add as much detail as you can!
Today&#8217;s fun included:

Adobe Illustrator
Photo to Trace
Pen Tool
Wacom
An [...]]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/01/random-illustrator-outlines/" title="Random Illustrator: Outlines"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=812&amp;w=180" width="1" height="1" alt="Random Illustrator: Outlines" style="float:left;padding:0 10px 10px 0;" ></a><p>The Pen Tool is quickly becoming my favorite Weapon of Choice. Today I doodled up a photo of myself that we might use for our &#8220;Who We Are&#8221; section. If you decide to create a neat traced image, take your time, and add as much detail as you can!<span id="more-812"></span></p>
<p>Today&#8217;s fun included:</p>
<ul>
<li>Adobe Illustrator</li>
<li>Photo to Trace</li>
<li>Pen Tool</li>
<li>Wacom</li>
<li>An hour</li>
</ul>
<p>My best tip for using the Pen Tool in illustrator: When you want to escape your line to start a new one, simply hit &#8220;P.&#8221; Before I realized this, I would add an extra step by hitting &#8220;V&#8221; to select the Pointer, and then P again. Yes, this saves you from hitting only 1 key, but when you are making hundreds of unique lines&#8230;</p>
<p><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/01/phil-2.gif" width="575" class="framed" /></p>
<p><img src="http://riotriot.net/wordpress/wp-content/uploads/yapb_cache/phil_3.6luw1tldckws4css4c408gcww.6as5qcllr4sgwoccg8gks0wks.th.jpeg" width="575" class="framed" /></p>
<p><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/01/Screen-shot-2010-01-26-at-7.51.04-PM.png" width="575" class="framed"></p>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/01/random-illustrator-outlines/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS3: Rounded Corners</title>
		<link>http://riotriot.net/2010/01/css-3-rounded-corners/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=css-3-rounded-corners</link>
		<comments>http://riotriot.net/2010/01/css-3-rounded-corners/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 08:22:59 +0000</pubDate>
		<dc:creator>Philip</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design & Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=790</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/01/css-3-rounded-corners/" title="CSS3: Rounded Corners"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=790&amp;w=180" width="1" height="1" alt="CSS3: Rounded Corners" style="float:left;padding:0 10px 10px 0;" ></a>CSS3 has a few very useful features, such as: Rounded Corners. If you are using a CSS3 compatible browser, you will notice our current version of our site uses many rounded corners. They are all done with CSS3. 
The following code works with Safari, Chrome and Firefox 2+. IE&#8230; is right out.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
.rounded-corners &#123;
  -webkit-border-top-left-radius: [...]]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/01/css-3-rounded-corners/" title="CSS3: Rounded Corners"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=790&amp;w=180" width="1" height="1" alt="CSS3: Rounded Corners" style="float:left;padding:0 10px 10px 0;" ></a><p>CSS3 has a few very useful features, such as: Rounded Corners. If you are using a CSS3 compatible browser, you will notice our current version of our site uses many rounded corners. They are all done with CSS3. <span id="more-790"></span></p>
<p>The following code works with Safari, Chrome and Firefox 2+. IE&#8230; is right out.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.rounded-corners</span> <span style="color: #00AA00;">&#123;</span>
  -webkit-border-top-left-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -webkit-border-top-right-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -webkit-border-bottom-left-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -webkit-border-bottom-right-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -khtml-border-radius-topleft<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -khtml-border-radius-topright<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -khtml-border-radius-bottomleft<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -khtml-border-radius-bottomright<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -moz-border-radius-topleft<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -moz-border-radius-topright<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>			
  -moz-border-radius-bottomleft<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -moz-border-radius-bottomright<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>	
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>You can also shorthand the Chrome and Firefox CSS3 corners. Safari does not play nice, so I usually use the full version for all three.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* set all corners */</span>
<span style="color: #6666ff;">.rounded-corners</span> <span style="color: #00AA00;">&#123;</span>
  -khtml-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>	
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* or assign each corner clockwise starting top left */</span>
<span style="color: #6666ff;">.rounded-corners</span> <span style="color: #00AA00;">&#123;</span>
  -khtml-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/01/css-3-rounded-corners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &amp; MySQL Query Result Loops</title>
		<link>http://riotriot.net/2010/01/php-mysql-query-result-loops/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=php-mysql-query-result-loops</link>
		<comments>http://riotriot.net/2010/01/php-mysql-query-result-loops/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 04:49:34 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Design & Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Query]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=707</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/01/php-mysql-query-result-loops/" title="PHP &#038; MySQL Query Result Loops"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=707&amp;w=180" width="1" height="1" alt="PHP &#038; MySQL Query Result Loops" style="float:left;padding:0 10px 10px 0;" ></a>Static content is dying, but dynamic sites are emerging left and right. Lets focus on using PHP and merge it with mySQL so we can pull some dynamic data!

The items needed in-order to make this tutorial work would be:

PHP 4+
mySQL 4+
Access to admin in the mySQL database
FTP program (if working remotely)
Basic knowledge of syntax



First, lets [...]]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/01/php-mysql-query-result-loops/" title="PHP &#038; MySQL Query Result Loops"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=707&amp;w=180" width="1" height="1" alt="PHP &#038; MySQL Query Result Loops" style="float:left;padding:0 10px 10px 0;" ></a><p>Static content is dying, but dynamic sites are emerging left and right. Lets focus on using <strong>PHP</strong> and merge it with <strong>mySQL</strong> so we can pull some dynamic data!</p>
<p><span id="more-707"></span><br />
The items needed in-order to make this tutorial work would be:</p>
<ul>
<li>PHP 4+</li>
<li>mySQL 4+</li>
<li>Access to admin in the mySQL database</li>
<li>FTP program (if working remotely)</li>
<li>Basic knowledge of syntax</li>
</ul>
<ol class="listed-steps">
<li>
<p>First, lets begin with developing the database. This will require creating a new database if you do not already have one available. <strong>Let&#8217;s create a database called: <u>example</u></strong>.</p>
</li>
<li>
<p>Once the database is created, we will then need to <strong>create a table inside the database called: <u>records</u></strong>. Below is a example SQL code to use:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span>  <span style="color: #ff0000;">'example'</span><span style="color: #66cc66;">.</span> <span style="color: #ff0000;">'records'</span> <span style="color: #66cc66;">&#40;</span>
<span style="color: #ff0000;">'id'</span> INT<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'name'</span> VARCHAR<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">25</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'email'</span> VARCHAR<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">255</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span>
<span style="color: #66cc66;">&#41;</span> ENGINE <span style="color: #66cc66;">=</span> MYISAM</pre></td></tr></table></div>

<p>The following code will create <strong>3</strong> columns in the database: <strong>id (int / 5 characters)</strong>, <strong>name (varChar / 25 characters)</strong>, and <strong>email (varChar / 100 characters)</strong>.  Setting <strong>id</strong> to &#8220;auto increment&#8221; means it will automatically come up with a new row-number as they are injected. This will allow us later on to pull specific records using this <strong>id</strong> field.</p>
</li>
<li>
<p>Next, lets <strong>begin with creating our first file: <u>db.inc.php</u></strong>. This will house our connection to the database, please be sure to use your own mySQL logins.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$hostname</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mysql_login</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;root&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mysql_password</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;yourpass&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$database</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;example&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hostname</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mysql_login</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$mysql_password</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Can't connect to mysql.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$database</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Can't connect to db.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The code there is somewhat more advanced, and too much to go over (im taking for granted you know some basic html/mysql commands).</p>
</li>
<li>
<p>Now lets create the file that will be pulling the data and listing the resulting data! <strong>Create the file: <u>results.php</u></strong> in the same folder as &#8220;db.inc.php&#8221;. In that file it will have:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'db.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$query</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM records&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;div id=<span style="color: #000099; font-weight: bold;">\&quot;</span>row<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">$row[name]</span> | <span style="color: #006699; font-weight: bold;">$row[email]</span>&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>After we required the &#8220;database&#8221; connection file, we then started to code our mySQL &#8220;<strong>query&#8221;</strong>: <u>SELECT * FROM records</u>. The asterisk means it will pull all the columns from the database.</p>
<p>We are then running the mySQL command &#8220;mysql_query&#8221; which will run that command through the database and grab all the rows and throws them into a array! Once it has them all, it stores them into that variable &#8220;<strong>$result</strong>&#8221; for later use in our application.</p>
<p>PHP&#8217;s &#8220;<strong>while</strong>&#8221; function is very valuable. It will repeat itself as long as there is records, once it runs out it will stop looping. As you can see in the code, it is looping the DIV &#8220;row&#8221; each time. Inside that DIV you see two php &#8220;variables&#8221;: <strong>$row[name]</strong> and <strong>$row[email]</strong>. The item that is inside the bracket is the &#8220;column&#8221; in the database. As said earlier, each row has been turned into an array, here is it turned into a usable item.</p>
</li>
<li>
<p>Last step is to return to your database program, and create a few records. <strong>If you want to just &#8220;inject&#8221; some SQL please use this:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span>  <span style="color: #ff0000;">'example'</span><span style="color: #66cc66;">.</span> <span style="color: #ff0000;">'records'</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">'id'</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">'name'</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">'email'</span>
<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>  <span style="color: #ff0000;">'jonathan'</span><span style="color: #66cc66;">,</span>  <span style="color: #ff0000;">'youremail@email.com'</span>
<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

</p>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/01/php-mysql-query-result-loops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Photoshop</title>
		<link>http://riotriot.net/2010/01/random-photoshop-hacknslash-of-the-day/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=random-photoshop-hacknslash-of-the-day</link>
		<comments>http://riotriot.net/2010/01/random-photoshop-hacknslash-of-the-day/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 04:15:43 +0000</pubDate>
		<dc:creator>Philip</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Awesome]]></category>
		<category><![CDATA[Bowling]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=692</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/01/random-photoshop-hacknslash-of-the-day/" title="Random Photoshop"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=692&amp;w=180" width="1" height="1" alt="Random Photoshop" style="float:left;padding:0 10px 10px 0;" ></a>Jon and I were trying to make tilt-shift images. This isn&#8217;t quite there.. but I liked it.. Plus its a small bowling alley in a hotel and that&#8217;s awesome. Next time I&#8217;m yelling, &#8220;Strike a pose!&#8221;
  
]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/01/random-photoshop-hacknslash-of-the-day/" title="Random Photoshop"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=692&amp;w=180" width="1" height="1" alt="Random Photoshop" style="float:left;padding:0 10px 10px 0;" ></a><p>Jon and I were trying to make tilt-shift images. This isn&#8217;t quite there..<span id="more-692"></span> but I liked it.. Plus its a small bowling alley in a hotel and that&#8217;s awesome. Next time I&#8217;m yelling, &#8220;Strike a pose!&#8221;</p>
<p> <a href="http://riotriot.net/wordpress/wp-content/uploads/2010/01/bowling.jpg" class="fancybox"><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/01/bowling.jpg" width="575" /></a> </p>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/01/random-photoshop-hacknslash-of-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canon S90: First Impressions</title>
		<link>http://riotriot.net/2010/01/canon-s90-first-impressions/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=canon-s90-first-impressions</link>
		<comments>http://riotriot.net/2010/01/canon-s90-first-impressions/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 03:46:59 +0000</pubDate>
		<dc:creator>Philip</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Misc.]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Awesome]]></category>
		<category><![CDATA[Canon]]></category>
		<category><![CDATA[Canon S90]]></category>
		<category><![CDATA[S90]]></category>

		<guid isPermaLink="false">http://riotriot.net/?p=672</guid>
		<description><![CDATA[<a href="http://riotriot.net/2010/01/canon-s90-first-impressions/" title="Canon S90: First Impressions"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=672&amp;w=180" width="1" height="1" alt="Canon S90: First Impressions" style="float:left;padding:0 10px 10px 0;" ></a>The Canon S90 is awesome. I am not going to do a write up telling you what is great and what is not so great about the camera, as there are many more qualified reviews from people who aren&#8217;t web developers. Attached below are just a few sample pictures from my trip to the Grand [...]]]></description>
			<content:encoded><![CDATA[<a href="http://riotriot.net/2010/01/canon-s90-first-impressions/" title="Canon S90: First Impressions"><img src="http://riotriot.net/wordpress/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=672&amp;w=180" width="1" height="1" alt="Canon S90: First Impressions" style="float:left;padding:0 10px 10px 0;" ></a><p>The Canon S90 is awesome. <span id="more-672"></span><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/01/porn-camera1.jpg" width="200" style="float:right;margin: 0 0 10px 10px;" class="framed" />I am not going to do a write up telling you what is great and what is not so great about the camera, as there are many more <a href="http://www.kenrockwell.com/canon/s90.htm" target="_blank">qualified reviews from people who aren&#8217;t web developers</a>. Attached below are just a few sample pictures from my trip to the Grand Canyon in January (re-sized only).</p>
<p><a href="http://riotriot.net/wordpress/wp-content/uploads/2010/01/tree.jpg" rel="s90"><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/01/tree.jpg" alt="" width="575" /></a><br />
<a href="http://riotriot.net/wordpress/wp-content/uploads/2010/01/bird.jpg" rel="s90"><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/01/bird.jpg" alt="" width="575" /></a><br />
<a href="http://riotriot.net/wordpress/wp-content/uploads/2010/01/sunrise.jpg" rel="s90"><img src="http://riotriot.net/wordpress/wp-content/uploads/2010/01/sunrise.jpg" alt="" width="575" /></a></p>
<p><a href="http://www.flickr.com/photos/tags/s90/" target="_blank" style="float:right; padding-bottom: 15px;">More awesome S90 photos from Flickr Community &raquo;</a></p>
<div class="clear-both"></div>
]]></content:encoded>
			<wfw:commentRss>http://riotriot.net/2010/01/canon-s90-first-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
