<?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>Sudo Bash</title>
	<atom:link href="http://sudobash.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://sudobash.net</link>
	<description>By Geeks - For Geeks</description>
	<lastBuildDate>Mon, 13 Feb 2012 21:47:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>WebDev &gt; Allow PHP in WordPress Widgets</title>
		<link>http://sudobash.net/webdev-allow-php-in-wordpress-widgets/</link>
		<comments>http://sudobash.net/webdev-allow-php-in-wordpress-widgets/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 19:03:47 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[allow]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=1075</guid>
		<description><![CDATA[The following will allow for you to post PHP in your widgets: Place in your functions.php file Appearance > Editor > Theme Functions (functions.php) add_filter('widget_text', 'php_text', 99); function php_text($text) { if (strpos($text, '&#60;' . '?') !== false) { ob_start(); eval('?' . '&#62;' . $text); $text = ob_get_contents(); ob_end_clean(); } return $text; } Now you can [...]]]></description>
			<content:encoded><![CDATA[<p>The following will allow for you to post PHP in your widgets:</p>
<p>Place in your functions.php file<br />
 Appearance > Editor > Theme Functions (functions.php)</p>
<pre class='brush: php;'>
add_filter('widget_text', 'php_text', 99);

function php_text($text) {
 if (strpos($text, '&lt;' . '?') !== false) {
 ob_start();
 eval('?' . '&gt;' . $text);
 $text = ob_get_contents();
 ob_end_clean();
 }
 return $text;
}
</pre>
<p>Now you can place php code so long as its within its &lt;?php and ?&gt; tags.<br />
<a href="http://www.binaryturf.com/php-text-widget-php-wordpress-text-widget/">Credit</a></p>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(1075, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 1"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_1075_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_1075_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/webdev-allow-php-in-wordpress-widgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDev &gt; CSS Stylings</title>
		<link>http://sudobash.net/webdev-css-stylings/</link>
		<comments>http://sudobash.net/webdev-css-stylings/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 16:55:10 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[info]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=1065</guid>
		<description><![CDATA[Just starting to make a note of some of my CSS creations: Informational Box SudoBash is proud to announce our newest office location 123 Kittens Street conveniently located 1 mile from LOLcat lane. &#60;style type='text/css'&#62; .info { border: 2px solid #D8D8D8; margin: 10px 0px; background-repeat: no-repeat; padding: 10px 0 10px 150px; background-position: 10px center; color: [...]]]></description>
			<content:encoded><![CDATA[<p>Just starting to make a note of some of my CSS creations:</p>
<p><strong>Informational Box</strong></p>
<style type='text/css'>
.info {
  border: 2px solid #D8D8D8;
  margin: 10px 0px;
  background-repeat: no-repeat;
  padding: 10px 0 10px 150px;
  background-position: 10px center;
  color: #00529B;
  background-color: #E0E0E0;
  background-image: url('http://www.employmentlawyernewyork.com/images/info.png');
}
</style>
<div class="info"><strong>SudoBash is proud to announce our newest office location</strong></p>
<p>123 Kittens Street conveniently located 1 mile from LOLcat lane.</p></div>
<pre class='brush: html'>
 &lt;style type='text/css'&gt;
.info {
  border: 2px solid #D8D8D8;
  margin: 10px 0px;
  background-repeat: no-repeat;
  padding: 10px 0 10px 150px;
  background-position: 10px center;
  color: #00529B;
  background-color: #E0E0E0;
  background-image: url('/images/info.png');
}
&lt;/style&gt;

&lt;div class="info"&gt;&lt;strong&gt;SudoBash is proud to announce our newest office location&lt;/strong&gt;&lt;br&gt;&lt;br&gt;

123 Kittens Street conveniently located 1 mile from LOLcat lane.&lt;/div&gt;
</pre>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(1065, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 0"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_1065_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_1065_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/webdev-css-stylings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BASH &gt; Recursively set file/directory permissions</title>
		<link>http://sudobash.net/bash-recursively-set-filedirectory-permissions/</link>
		<comments>http://sudobash.net/bash-recursively-set-filedirectory-permissions/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 17:09:53 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[chmodding]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[recursively]]></category>
		<category><![CDATA[set]]></category>
		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=1053</guid>
		<description><![CDATA[Move to the directory you want to start chmodding files in and run the following: Recursively set FILE permissions. find . -type f -exec chmod 644 {} \; Recursively set DIRECTORY permissions. find . -type d -exec chmod 755 {} \; *Note, obviously you can change the chmod number to whatever you want, 777, 600, [...]]]></description>
			<content:encoded><![CDATA[<p>Move to the directory you want to start chmodding files in and run the following:</p>
<p>Recursively set <strong>FILE</strong> permissions.</p>
<pre class='brush: bash;'>
find . -type f -exec chmod 644 {} \;
</pre>
<p>Recursively set <strong>DIRECTORY</strong> permissions.</p>
<pre class='brush: bash;'>
find . -type d -exec chmod 755 {} \;
</pre>
<p>*Note, obviously you can change the chmod number to whatever you want, 777, 600, etc.</p>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(1053, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 1"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_1053_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_1053_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/bash-recursively-set-filedirectory-permissions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web Dev &gt; Select first n words of a sentence</title>
		<link>http://sudobash.net/web-dev-select-first-n-words-of-a-sentence/</link>
		<comments>http://sudobash.net/web-dev-select-first-n-words-of-a-sentence/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 19:25:47 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[array_slice]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[explode]]></category>
		<category><![CDATA[implode]]></category>
		<category><![CDATA[n]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[read more]]></category>
		<category><![CDATA[sentence]]></category>
		<category><![CDATA[teaser]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=1048</guid>
		<description><![CDATA[Useful for giving a teaser of a post and then including &#8230; on the end followed by &#8220;Read More&#8221;. $sentence = "This is my sentence, there are many like it but this one is mine. What do you think of it?"; $n = 10; // Customize to however many words you want to actually show [...]]]></description>
			<content:encoded><![CDATA[<p>Useful for giving a teaser of a post and then including &#8230; on the end followed by &#8220;Read More&#8221;.</p>
<pre class="brush: php;">
$sentence = "This is my sentence, there are many like it but this one is mine. What do you think of it?";
$n = 10; // Customize to however many words you want to actually show
$teaser = implode(' ', array_slice(explode(' ', $sentence), 0, $n));

echo $teaser."...<a href='#'>READ MORE</a>
</pre>
<p>Which should result in:<br />
This is my sentence, there are many like it but&#8230;READ MORE</p>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(1048, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 0"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_1048_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_1048_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/web-dev-select-first-n-words-of-a-sentence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Dev &gt; Keep your copyright date current automatically</title>
		<link>http://sudobash.net/web-dev-keep-your-copyright-date-current-automatically/</link>
		<comments>http://sudobash.net/web-dev-keep-your-copyright-date-current-automatically/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 20:46:11 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[automagically]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[automatically]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[current]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[year]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=1033</guid>
		<description><![CDATA[Here&#8217;s a quick little tip I&#8217;ve been using recently with the new year having rolled around. I&#8217;ve started replacing all of my &#169; 2011 code with the following. This will always return the date of the current year. That way you don&#8217;t have to remember to update it all over the place every time we [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick little tip I&#8217;ve been using recently with the new year having rolled around. I&#8217;ve started replacing all of my &copy; 2011 code with the following.  This will always return the date of the current year.  That way you don&#8217;t have to remember to update it all over the place every time we &#8220;celebrate&#8221; a new year.</p>
<pre class='brush: php'>
&lt;?php echo date('Y'); ?&gt;
</pre>
<p>So now I don&#8217;t ever have to update this post and the current year should always be reflected here: 2012</p>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(1033, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 0"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_1033_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_1033_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/web-dev-keep-your-copyright-date-current-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Dev &gt; Populate PHP/HTML table from MySQL database</title>
		<link>http://sudobash.net/web-dev-populate-phphtml-table-from-mysql-database/</link>
		<comments>http://sudobash.net/web-dev-populate-phphtml-table-from-mysql-database/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 03:56:58 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[nest]]></category>
		<category><![CDATA[nested]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[result]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[where]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=997</guid>
		<description><![CDATA[Hey again all, for this post I&#8217;ll be covering how to populate a PHP/HTML table by way of looping through a table in mysql. I&#8217;ll be using the sample database provided by http://www.mysqltutorial.org/mysql-sample-database.aspx which has to do with models (cars, planes, ships, etc). Everyone has differing levels of knowledge so I&#8217;ll be including some basics [...]]]></description>
			<content:encoded><![CDATA[<p>Hey again all, for this post I&#8217;ll be covering how to populate a PHP/HTML table by way of looping through a table in mysql.  I&#8217;ll be using the sample database provided by <a href="http://www.mysqltutorial.org/mysql-sample-database.aspx" title="MySQL Sample Database" target="_blank">http://www.mysqltutorial.org/mysql-sample-database.aspx</a> which has to do with models (cars, planes, ships, etc).  Everyone has differing levels of knowledge so I&#8217;ll be including some basics as well such as connecting to the mysql database (and closing it later on). </p>
<p>The table we&#8217;ll be using in the database is &#8216;products&#8217;.  It has the following columns:</p>
<pre>
productCode        - A unique inventory number
productName        - Name of the product
productLine        - Basic descriptor, 'Motorcycles', 'Classic Cars', etc
productScale       - This models scale size
productVendor      - Company that built the model
productDescription - Detailed description of product
quantityInStock    - Current number of quantity in stock
buyPrice           - Listed price on the "website"
MSRP               - Manufacturers Suggested Retail Price
</pre>
<p>If I know I&#8217;m going to be using my mysql database in multiple files I&#8217;ll always throw the connection in something like a &#8216;dbconnect.php&#8217; file.  Here&#8217;s an example:</p>
<pre class='brush: php;'>
&lt;?php
  mysql_connect("localhost", "MYSQL_USERNAME", "MYSQL_PASSWORD") or die(mysql_error());
  mysql_select_db("MYSQL_TABLE") or die(mysql_error());
?&gt;
</pre>
<p>Now you can include this in every file, or better yet in your header file which will get included everywhere else.  So for example in your header.php file you could throw in:</p>
<pre class='brush: php;'>
&lt;?php
  require_once('dbconnect.php');
?&gt;
</pre>
<p>Alright, so now you&#8217;ve got your connection to your database and the appropriate database selected. We&#8217;ll skip over the other content that you want to eventually add and say (for this example) that we want to list all of our models.  We&#8217;ll look at doing this a few different ways, first off we&#8217;ll go simple and just request everything from the database and then we&#8217;ll tell php how to spit that all out to us.<br />
<span id="more-997"></span><br />
So now in our file we&#8217;ll want to first build the sql command, then tell it to run the command, and finally we&#8217;ll use a while loop to run through each result.</p>
<p>This can be written a few different ways but the following is typically how I do it:</p>
<pre class='brush: php;'>
&lt;?php
  $sql = "SELECT * FROM products";
  $result = mysql_query($sql)or die(mysql_error());
&gt;
</pre>
<p>Ok, so now we&#8217;ve specified the query to run by setting the variable $sql, and followed that by running our query and populating $result with it. So now php has all the information and its stored in the $result array.  What now? Now we want to build our output using php and html.  Here we&#8217;ll build on what we have.</p>
<pre class='brush: php;'>
&lt;?php

  // For the purpose of saving space on my post I'm going to limit the amount of results to 4, see "LIMIT 4" below.
  $sql = "SELECT * FROM products LIMIT 4";
  $result = mysql_query($sql)or die(mysql_error());

  // Now let's start building our table, I'll go line by line just like HTML so it's easier to read.
  // I don't think we need every one of the details about each model so I'm going to just include what
  // I think my customer needs to know on a product overview page.  This will just list the name, description,
  // quantity in stock, scale, and price of each item.  We need to put the table opening tag and first row
  // outside of the while loop first otherwise every time we process a row we'll get a new table and tr.

  echo "&lt;table&gt;";
  echo "&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Model Scale&lt;/th&gt;&lt;th&gt;# In Stock&lt;/th&gt;&lt;th&gt;Price&lt;/th&gt;&lt;/tr&gt;";

  while($row = mysql_fetch_array($result)){
  // Before we close out of PHP, lets define all of our variables so they are easier to remember and work with,
  // you can skip this though if you just want to directly reference each row.

  $name     = $row['productName'];
  $scale    = $row['productScale'];
  $desc     = $row['productDescription'];
  $quantity = $row['quantityInStock'];
  $price    = $row['buyPrice'];

// Now for each looped row

echo "&lt;tr&gt;&lt;td style='width: 200px;'&gt;".$name."&lt;/td&gt;&lt;td style='width: 600px;'&gt;".$desc."&lt;/td&gt;&lt;td&gt;".$scale."&lt;/td&gt;&lt;td&gt;".$quantity."&lt;/td&gt;&lt;td&gt;".$price."&lt;/td&gt;&lt;/tr&gt;";

} // End our while loop
echo "&lt;/table&gt;
</pre>
<p>We should now have something like the following if we did everything correctly:<br />
<iframe src='/db_example_models.php' width='100%' height='210px' frameborder=0></iframe></p>
<p>Now you would be free to go back and change the style and such as you like, maybe give each td a little room to breath by adding some cellpadding or cellspacing or whatever you like.  You can also go back and change your $sql to be more specific.  Say for example you only wanted to list products that had a scale of 1:12.  You could change your $sql to the following:</p>
<pre class='brush: php;'>
$sql = "SELECT * FROM products WHERE productScale='1:12'";
</pre>
<p>You would then see:<br />
<iframe src='/db_example_models_scale.php' width='100%' height='250px' frameborder=0></iframe></p>
<p>Once you&#8217;ve mastered doing while loop you could add another one above it.  For example what you could do would be to get the result of all products, while loop through that, and then while you are in that while loop you could use another while loop inside of it to iterate through each unique scale.</p>
<p>This will be a large example so I&#8217;ll just include a link to it so you can see it all in one place.<br />
<a href="http://sudobash.net/db_example_models_nested.php" title="PHP MySQL Nested While Loop" target="_blank">Nested Whiles</a></p>
<p>The code for that is here:</p>
<pre class='brush: php;'>
&lt;style type='text/css'&gt;
 th { text-align: left; }
 td { padding: 5px; border-bottom: 1px solid black; border-collapse: collapse; border-spacing: 0px; }
 table { border: 2px solid black; }
&lt;/style&gt;
&lt;?php
  mysql_connect("localhost", "MYSQL_USERNAME", "MYSQL_PASSWORD") or die(mysql_error());
  mysql_select_db("MYSQL_DATABASE") or die(mysql_error());

  $sql = "SELECT DISTINCT(productScale) FROM products";
  $result = mysql_query($sql)or die(mysql_error());

  while($info = mysql_fetch_array($result)){

  $scale = $info['productScale'];

  $sql_scale = "SELECT * FROM products WHERE productScale='".$scale."'";
  $result_scale = mysql_query($sql_scale)or die(mysql_error());

  echo "&lt;div style='width: 100%; text-align: center;'&gt;";
  echo "&lt;h1&gt;".$scale." Models&lt;/h1&gt;";
  echo "&lt;table style='margin: auto auto;'&gt;";
  echo "&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Model Scale&lt;/th&gt;&lt;th&gt;# In Stock&lt;/th&gt;&lt;th&gt;Price&lt;/th&gt;&lt;/tr&gt;";

  while($row = mysql_fetch_array($result_scale)){

   $name     = $row['productName'];
   $scale    = $row['productScale'];
   $desc     = $row['productDescription'];
   $quantity = $row['quantityInStock'];
   $price    = $row['buyPrice'];

   // Now for each looped row

   echo "&lt;tr&gt;&lt;td style='width: 200px;'&gt;".$name."&lt;/td&gt;&lt;td style='width: 600px;'&gt;".$desc."&lt;/td&gt;&lt;td style='width: 100px;'&gt;".$scale."&lt;/td&gt;&lt;td style='width: 100px;'&gt;".$quantity."&lt;/td&gt;&lt;td style='width: 100px;'&gt;".$price."&lt;/td&gt;&lt;/tr&gt;";

  } // End our scale while loop
 echo "&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;";
} // End our master loop
</pre>
<p>Oh, and don&#8217;t forget to close your mysql connection in your footer or wherever you finish up using it.</p>
<pre class='brush: php;'>
  mysql_close();
</pre>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(997, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 1"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_997_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_997_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/web-dev-populate-phphtml-table-from-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Dev &gt; Validate Password creation with PHP</title>
		<link>http://sudobash.net/web-dev-validate-password-creation-with-php/</link>
		<comments>http://sudobash.net/web-dev-validate-password-creation-with-php/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 15:40:59 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[confirm]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[validate]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[verify]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=984</guid>
		<description><![CDATA[The following can be used to test for different criteria in passwords. &#60;?php $min = 6; $max = 20; $password = $_POST['password']; $confirmpw = $_POST['confirmpw']; if($password != $confirmpw){ $error .= "Password and Confirm password do not match! &#60;br /&#62;"; } if( strlen($password) &#60; $min ) { $error .= "Password too short! &#60;br /&#62;"; } if( [...]]]></description>
			<content:encoded><![CDATA[<p>The following can be used to test for different criteria in passwords.</p>
<pre class="brush: php;">
&lt;?php

$min = 6;
$max = 20;
$password = $_POST['password'];
$confirmpw = $_POST['confirmpw'];

if($password != $confirmpw){
    $error .= "Password and Confirm password do not match! &lt;br /&gt;";
}

if( strlen($password) &lt; $min ) {
    $error .= "Password too short! &lt;br /&gt;";
}

if( strlen($password) &gt; $max ) {
    $error .= "Password too long! &lt;br /&gt;";
}

if( !preg_match("#[0-9]+#", $password) ) {
    $error .= "Password must include at least one number! &lt;br /&gt;";
}

if( !preg_match("#[a-z]+#", $password) ) {
    $error .= "Password must include at least one letter! &lt;br /&gt;";
}

if( !preg_match("#[A-Z]+#", $password) ) {
    $error .= "Password must include at least one CAPITAL! &lt;br /&gt;";
}

if( !preg_match("#\W+#", $password) ) {
    $error .= "Password must include at least one symbol! &lt;br /&gt;";
}

if($error){
        echo "Password Failure: $error";
} else {
  // Code to execute on success.
}
?&gt;</pre>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(984, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 1"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_984_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_984_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/web-dev-validate-password-creation-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vmWare &gt; Boot to fullscreen VM after host boots.</title>
		<link>http://sudobash.net/vmware-boot-to-fullscreen-vm-after-host-boots/</link>
		<comments>http://sudobash.net/vmware-boot-to-fullscreen-vm-after-host-boots/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 17:08:54 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vmWare]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[workstation boot]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=974</guid>
		<description><![CDATA[Create a shortcut with the following TARGET. &#8220;C:\Program Files\VMware\VMware Workstation\vmware.exe&#8221; -X &#8220;C:\Users\YOUR_USER\Documents\Virtual Machines\VMNAME\FILENAME.vmx&#8221; The -X opens in Full screen (before you go looking, I&#8217;ll save you the trouble &#8211; there is no dual screen option as of the writing of this article.) Replace &#8220;C:\Users\YOUR_USER\Documents\Virtual Machines\VMNAME\FILENAME.vmx&#8221; with your vmx file location. The quotes are required. Put [...]]]></description>
			<content:encoded><![CDATA[<p>Create a shortcut with the following TARGET.</p>
<p><strong>&#8220;C:\Program Files\VMware\VMware Workstation\vmware.exe&#8221; -X &#8220;C:\Users\YOUR_USER\Documents\Virtual Machines\VMNAME\FILENAME.vmx&#8221;</strong><br />
<img src="http://sudobash.net/images/new_shortcut.png" alt="New Shortcut" /></p>
<p>The -X opens in Full screen (before you go looking, I&#8217;ll save you the trouble &#8211; there is no dual screen option as of the writing of this article.)<br />
Replace &#8220;C:\Users\YOUR_USER\Documents\Virtual Machines\VMNAME\FILENAME.vmx&#8221; with your vmx file location.<br />
The quotes are required.</p>
<p>Put the shortcut into the Windows Startup folder<br />
<img src="http://sudobash.net/images/windows_startup.png" alt="Windows Startup Folder" /></p>
<p>Voila!<br />
<img src="http://sudobash.net/images/ubuntu_1110_vm.png" alt="Ubuntu" /></p>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(974, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 2"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_974_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_974_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/vmware-boot-to-fullscreen-vm-after-host-boots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Dev &gt; Use onClick to clear a value</title>
		<link>http://sudobash.net/web-dev-use-onclick-to-clear-a-value/</link>
		<comments>http://sudobash.net/web-dev-use-onclick-to-clear-a-value/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 14:11:29 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[onclick]]></category>
		<category><![CDATA[this]]></category>
		<category><![CDATA[value]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=966</guid>
		<description><![CDATA[The following can be used to clear a value. I regularly use this for website search bars. onclick="this.value=''" Of course if you wanted to you could also have it change the value to something else instead of blanking it out. onclick="this.value='New Value'"]]></description>
			<content:encoded><![CDATA[<p>The following can be used to clear a value.  I regularly use this for website search bars.</p>
<pre class="brush: html;">onclick="this.value=''"</pre>
<p>Of course if you wanted to you could also have it change the value to something else instead of blanking it out.</p>
<pre class="brush: html;">onclick="this.value='New Value'"</pre>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(966, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 0"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_966_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_966_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/web-dev-use-onclick-to-clear-a-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursively set group permissions to match owner permissions</title>
		<link>http://sudobash.net/recursively-set-group-permissions-to-match-owner-permissions/</link>
		<comments>http://sudobash.net/recursively-set-group-permissions-to-match-owner-permissions/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 14:52:56 +0000</pubDate>
		<dc:creator>Scott Rowley</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[owner]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[recursive]]></category>

		<guid isPermaLink="false">http://sudobash.net/?p=960</guid>
		<description><![CDATA[I have had need of this multiple times in the past, just making a note of it here: chmod -R g=u directory_name/]]></description>
			<content:encoded><![CDATA[<p>I have had need of this multiple times in the past, just making a note of it here:</p>
<pre class='brush: bash' >chmod -R g=u directory_name/</pre>
<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(960, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thanks!: 2"
                class="thanks_button thanks_large thanks_black"
                style="background-image:url(http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/thanks_large_black.png);  font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_960_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_960_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://sudobash.net/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://sudobash.net/recursively-set-group-permissions-to-match-owner-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

