<?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>McGelligot on the Spot &#187; mcgelligot</title>
	<atom:link href="http://www.mcgelligot.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mcgelligot.com</link>
	<description>Thoughts of a Web Publisher</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:41:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Quote Marks in Parameters in SQL</title>
		<link>http://www.mcgelligot.com/2012/02/02/quote-marks-in-parameters-in-sql/</link>
		<comments>http://www.mcgelligot.com/2012/02/02/quote-marks-in-parameters-in-sql/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 15:14:56 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=506</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/02/02/quote-marks-in-parameters-in-sql/' addthis:title='Quote Marks in Parameters in SQL'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Often in SQL examples you will see quote marks around a string that is being operated upon. Generally, a straight string is not often used in general practice. It is more likely to be a variable and more likely yet to be a column. Having or not having quote marks can make a huge difference in [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/02/02/quote-marks-in-parameters-in-sql/' addthis:title='Quote Marks in Parameters in SQL' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Often in SQL examples you will see quote marks around a string that is being operated upon. Generally, a straight string is not often used in general practice. It is more likely to be a variable and more likely yet to be a column. Having or not having quote marks can make a huge difference in the results given by a function. We will use the LEFT() function as an example. The left function is a way to get the leftmost characters from a<br />
string.</p>
<p><strong>SELECT LEFT(&#8216;string&#8217;, number_of_characters)</strong></p>
<p>To get the 7 left-most characters from a specific column in every row of a table the following would work:</p>
<p><strong>SELECT LEFT(name, 7) FROM </strong><strong>fict_chars</strong></p>
<p>It should be noted for this and for other functions that if the string is in single quotes that SQL will see it as a literal string. If it is not, SQL will see it as a column. Thus, had we used &#8216;name&#8217;, the result would have been “name” <em>for each row</em>, and not the actual name drawn from the specified column.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/02/02/quote-marks-in-parameters-in-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL: INSERT Statement vs. INSERT() Function</title>
		<link>http://www.mcgelligot.com/2012/02/01/sql-insert-statement-vs-insert-function/</link>
		<comments>http://www.mcgelligot.com/2012/02/01/sql-insert-statement-vs-insert-function/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 20:39:47 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=498</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/02/01/sql-insert-statement-vs-insert-function/' addthis:title='SQL: INSERT Statement vs. INSERT() Function'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Generally I am a fan of SQL and how it works, but there is a function that I find irritating. Not because of what it does, but because of its name, &#8220;INSERT()&#8221;. Why, oh why would you give a function the same name as a statement that already exists? I am sure there is a story behind this and [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/02/01/sql-insert-statement-vs-insert-function/' addthis:title='SQL: INSERT Statement vs. INSERT() Function' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div id="attachment_502" class="wp-caption alignleft" style="width: 210px"><a href="http://www.mcgelligot.com/wp-content/uploads/2012/02/twins.png"><img class="size-full wp-image-502" title="Twins - not" src="http://www.mcgelligot.com/wp-content/uploads/2012/02/twins.png" alt="Twins they are not." width="200" height="156" /></a><p class="wp-caption-text">Just because they look alike...</p></div>
<p>Generally I am a fan of SQL and how it works, but there is a function that I find irritating. Not because of what it does, but because of its name, &#8220;INSERT()&#8221;. Why, oh why would you give a function the same name as a statement that already exists? I am sure there is a story behind this and it probably goes back to family squabbles occuring in the 10th century AD, or at least to the 1970s when Chamberlin and Boyce first conceived RDBMS. Suffice it to say that it could cause confusion when quickly glancing over code or when newcomers are learning the language.</p>
<p>Just know that the two are different. The statement is the familiar, much used <a href="http://www.indepthinfo.com/sql/insert-into-sql.php">instruction to the database to add a row to a table</a>.</p>
<p><strong>INSERT INTO table (column1, column2, etc.)</strong><br />
<strong>VALUES(&#8216;value1&#8242;, &#8216;value2&#8242;, &#8216;etc.&#8217;)</strong></p>
<p>Meanwhile, the INSERT() function is designed to replace text within a string. It does this using the following syntax:</p>
<p><strong>INSERT(&#8216;string&#8217;, position, length, &#8216;inserted_string&#8217;)</strong></p>
<p>The first parameter is the string to be operated upon. The position is where the insertion should begin. Length defines how many characters should be replaced. The fourth parameter is the string to be injected.</p>
<p>A simple example:</p>
<p><strong>SELECT INSERT(&#8216;Jane Porter was the heroine in Harry Potter.&#8217;, 32, 12, &#8216;Tarzan&#8217;)</strong></p>
<p>Our result, &#8220;Jane Porter was the heroine in Tarzan.&#8221; Note that the character specified in the second parameter is over-written as are the subsequent 11 characters, 12 characters in all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/02/01/sql-insert-statement-vs-insert-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The SQL FIELD() Function</title>
		<link>http://www.mcgelligot.com/2012/01/31/the-sql-field-function/</link>
		<comments>http://www.mcgelligot.com/2012/01/31/the-sql-field-function/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 20:12:22 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=496</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/31/the-sql-field-function/' addthis:title='The SQL FIELD() Function'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>The FIELD() function is, in a sense, the inverse of ELT() in that ELT will return a string from a specific numbered position in an array of strings, while FIELD() returns the field position that matches (not the same as &#8220;contains&#8221;) the string listed as the first parameter. Syntax: SELECT FIELD(&#8216;string_to_match&#8217;, &#8216;string1&#8242;, &#8216;string2&#8242;, &#8216;etc.&#8217;) Here [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/31/the-sql-field-function/' addthis:title='The SQL FIELD() Function' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>The FIELD() function is, in a sense, the inverse of ELT() in that ELT will return a string from a specific numbered position in an array of strings, while FIELD() returns the field position that matches (not the same as &#8220;contains&#8221;) the string listed as the first parameter. Syntax:</p>
<p><strong>SELECT FIELD(&#8216;string_to_match&#8217;, &#8216;string1&#8242;, &#8216;string2&#8242;, &#8216;etc.&#8217;)</strong></p>
<p>Here is the field function in action:</p>
<p><strong>SELECT FIELD(&#8216;Scarlet&#8217;, &#8216;Melanie&#8217;, &#8216;Rhett&#8217;, &#8216;Scarlet&#8217;, &#8216;Ashley&#8217;, &#8216;Scarletta&#8217;)</strong></p>
<p>This will return &#8220;3&#8243;. Though 5 contains &#8220;Scarlet&#8221;, it is not equivalent to &#8220;Scarlet&#8221;. Had position 5 also been equivalent to &#8220;Scarlet&#8221; the result would still have been only &#8220;3&#8243;. Later matches are ignored.</p>
<p>Both FIELD() and ELT() are a kind of test. They can be used when you are looking for one item out of a group of alternatives. The result can be cranked through a series of if/then statements or switch/case to determine a course of action. This is another place where some of the work done by the server can be taken on by the database.</p>
<p><a href="http://www.indepthinfo.com/sql-functions/">Read more about SQL Functions.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/31/the-sql-field-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EXPORT_SET() SQL Function, Why?</title>
		<link>http://www.mcgelligot.com/2012/01/30/export_set-sql-function-why/</link>
		<comments>http://www.mcgelligot.com/2012/01/30/export_set-sql-function-why/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 01:29:40 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=493</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/30/export_set-sql-function-why/' addthis:title='EXPORT_SET() SQL Function, Why?'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>In the course of writing my book on SQL, I had the opportunity to explore a function I had not heard of before, the EXPORT_SET() function. In my investigations about this function, I discovered that I am not the only person dubious about it. The thing is, every explanation I could find for it was [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/30/export_set-sql-function-why/' addthis:title='EXPORT_SET() SQL Function, Why?' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>In the course of writing my book on SQL, I had the opportunity to explore a function I had not heard of before, the <a href="http://www.indepthinfo.com/sql-functions/export-set-function-sql.php">EXPORT_SET() function</a>. In my investigations about this function, I discovered that I am not the only person dubious about it. The thing is, every explanation I could find for it was nearly word for word the same down to the examples. This was a good indication that the authors were just parroting each other. When I write about a function I try to use it. At least I will go to the mySQL interface and try out a few variations on it. In this way I get a more intimate knowledge than is possible just reading something someone else has written, especially when that something else is incomplete.</p>
<p>My problem with the EXPORT_SET() function is that I was having trouble figuring out what I could do with it. So I investigated this aspect for an hour or two, surfing here and there I found nothing that would explain why you would ever want to use a function that basically returns an array of bits that comprise a number and lists them in reverse order. Obviously someone wrote this function for a vital purpose. I thought the purpose mignt be found in the name. EXPORT is a clue. After thorough investigation I see it has been used to port data between applications. A few thought experiments made me realize it could also be used in security as a means of encrypting data. I am sure there is more to it.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/30/export_set-sql-function-why/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Security: Why Log Out?</title>
		<link>http://www.mcgelligot.com/2012/01/26/internet-security-why-log-out/</link>
		<comments>http://www.mcgelligot.com/2012/01/26/internet-security-why-log-out/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 17:09:55 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=488</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/26/internet-security-why-log-out/' addthis:title='Internet Security: Why Log Out?'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>You know why it is important to log into your account on your various secure destinations.  First, you can&#8217;t access your info unless you do! But more importantly no one else can access the info unless he or she can get your user name and password.  So your account is safe right? Wrong, there are devious ways [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/26/internet-security-why-log-out/' addthis:title='Internet Security: Why Log Out?' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div id="attachment_491" class="wp-caption alignleft" style="width: 260px"><a href="http://www.mcgelligot.com/wp-content/uploads/2012/01/security-shield.png"><img class="size-full wp-image-491" title="security-shield" src="http://www.mcgelligot.com/wp-content/uploads/2012/01/security-shield.png" alt="Security Shield" width="250" height="285" /></a><p class="wp-caption-text">Be Secure...LOG OUT!</p></div>
<p>You know why it is important to log into your account on your various secure destinations.  First, you can&#8217;t access your info unless you do! But more importantly no one else can access the info unless he or she can get your user name and password.  So your account is safe right?</p>
<p>Wrong, there are devious ways of getting your user name and password. One easy way is through packet sniffing. I am convinced that packet sniffing is a routine operation around hotels, restaurants, etc. I have had my servers broken into TWICE while I was on vacation. Both times it was after I logged into an FTP account. Malware was installed both times and it was alot of work to get things straightened out, not to mention the fact that all that time spent trying to fix the problem put a damper on my vacations.</p>
<p>Well, there is no better learned lessons than those acquired in the school of hard knocks. I put my servers on SSH. That was just the start. I reviewed all php code and forms on the site. I created software to monitor changes to vulnerable pages and severely limited access to website code. Any suspicious onsite changes are logged and I am notified by email. That was two or three years ago, and I have been unassaulted since. However, without taking further precautions, I could still have been vulnerable to attack. In fact we are always vulnerable to attack, even with seemingly secure accounts especially if we go about getting into accounts while using publicly provided internet. Because through packet sniffing (someone watching the flow of traffic on a particular hub) doesn&#8217;t always need a password and a user name. They can simply piggy-back their way into your account by mimmicking your authentication process and headers. As long as your account is open a hacker could theoretically operate inside your account. The way to preclude or at least foreshorten this possibility is to LOG OUT!</p>
<p>I presume you are already savy enough to know that you must log out of accounts and close the browser on public computers so the next user can&#8217;t access your account.</p>
<p>For the user taking advantage of a &#8220;hotspot&#8221;, the best policy, especially in a public place is to make sure to have a secure connection (look for the green bar on the Url at the top of the page), know what you want to do when you log into your account, get your business done, and don&#8217;t forget to log out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/26/internet-security-why-log-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google AdSense Does NOT Appear on Kindle Fire</title>
		<link>http://www.mcgelligot.com/2012/01/25/google-adsense-does-not-appear-on-kindle-fire/</link>
		<comments>http://www.mcgelligot.com/2012/01/25/google-adsense-does-not-appear-on-kindle-fire/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 01:37:46 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=485</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/25/google-adsense-does-not-appear-on-kindle-fire/' addthis:title='Google AdSense Does NOT Appear on Kindle Fire'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>I just got a Kindle Fire. I decided that I should take a look at my own websites just to see how they looked on the 7 inch screen. The sites appeared okay, but much to my wondering eyes did NOT appear&#8230; well there was no miniature sleigh or eight tiny reindeer, but neither were [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/25/google-adsense-does-not-appear-on-kindle-fire/' addthis:title='Google AdSense Does NOT Appear on Kindle Fire' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>I just got a Kindle Fire. I decided that I should take a look at my own websites just to see how they looked on the 7 inch screen. The sites appeared okay, but much to my wondering eyes did NOT appear&#8230; well there was no miniature sleigh or eight tiny reindeer, but neither were there any Adsense ads.</p>
<p>What to do? What to do? I could write an application that would change it to a different ad, maybe Chitika, when a Kindle browser shows up. In fact, I probably will do that for one or two of my sites, but so far Kindle web traffic is not high enough to worry about it too much. I have not seen too much traffic thus far from the fire, but it is sure to grow the way the item has been selling. On the other hand it seems to be a device more in tune with selling books, mags, music, and movies. The internet side will probably grow slowly. No doubt the situation can change as well.</p>
<p>In any case, I find Amazon&#8217;s approach interesting and also disturbing. Blocking ads on my websites is like stealing content from me. It is amazing how the big boys never play by the rules. The only way I can continue to create content is to get paid for doing so. Meanwhile I am sure the boys at Amazon think they are only tweaking Google.</p>
<p>It&#8217;s just one more development to react to.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/25/google-adsense-does-not-appear-on-kindle-fire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X and Y Axis Page Layout</title>
		<link>http://www.mcgelligot.com/2012/01/25/x-and-y-axis-page-layout/</link>
		<comments>http://www.mcgelligot.com/2012/01/25/x-and-y-axis-page-layout/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 16:25:22 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[Content Creation]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=479</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/25/x-and-y-axis-page-layout/' addthis:title='X and Y Axis Page Layout'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>The current manifestation of this blog has a column that runs up the right side and overlays the horizontal nav bar at the top. I admittedly like this look. I call it the X and Y axis page layout. This is because, for me, it resembles a cartesian plane with the column representing &#8220;y&#8221; and [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/25/x-and-y-axis-page-layout/' addthis:title='X and Y Axis Page Layout' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>The current manifestation of this blog has a column that runs up the right side and overlays the horizontal nav bar at the top. I admittedly like this look. I call it the X and Y axis page layout. This is because, for me, it resembles a cartesian plane with the column representing &#8220;y&#8221; and the nav bar representing &#8220;x&#8221;. I think I like it because it makes elegant use of the space available and over the years I have gotten tired of the same-ol&#8217;-same-ol&#8217; with page layouts.</p>
<p>In any case, I decided to do a redesign of <a href="http://www.learnchessrules.com">Learn Chess Rules</a>. I decided to employ this design concept in the simplest manner possible, using something close to primary colors. I wanted to see the format in its essense. I also employed a fixed div at the bottom of the page. I like the effect, but the wife liked the ambiance of the site before I changed it. At this time many of the support pages are still in the old format, the FAQs for example, so you can see the difference.</p>
<p>I originally wrote the Chess Rules site in 1998. My memory has me starting at ten in the evening and working to four in the AM. If so, I was working fast. The redesign and rewrite took me two days.</p>
<p>The internet moves faster than a speeding bullet, and even faster than Superman. When I wrote the site it was all tables. Even though in the rewrite I employed a table here and there, where appropriate, the entire structure hangs on the &lt;div&gt; tag and the CSS behind it.</p>
<div id="attachment_480" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.mcgelligot.com/wp-content/uploads/2012/01/learnchessrules.png"><img class="size-full wp-image-480" title="learnchessrules" src="http://www.mcgelligot.com/wp-content/uploads/2012/01/learnchessrules.png" alt="Learn Chess Rules" width="500" height="364" /></a><p class="wp-caption-text">X and Y Axis at Learn Chess Rules</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/25/x-and-y-axis-page-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DCL SQL GRANT and REVOKE</title>
		<link>http://www.mcgelligot.com/2012/01/21/dcl-sql-grant-and-revoke/</link>
		<comments>http://www.mcgelligot.com/2012/01/21/dcl-sql-grant-and-revoke/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 16:10:28 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=476</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/21/dcl-sql-grant-and-revoke/' addthis:title='DCL SQL GRANT and REVOKE'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>SQL is broken up into several sub-languages. One of these is DCL which stands for Data Control Language. What it is really about is designating who has permission to do what on a database. Ultimately, this is a security thing. If we could implicitly trust everyone, we would just grant all power to everyone. In [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/21/dcl-sql-grant-and-revoke/' addthis:title='DCL SQL GRANT and REVOKE' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>SQL is broken up into several sub-languages. One of these is <a href="http://www.indepthinfo.com/sql-dcl/">DCL which stands for Data Control Language</a>. What it is really about is designating who has permission to do what on a database. Ultimately, this is a security thing. If we could implicitly trust everyone, we would just grant all power to everyone. In the real world of the anonymous internet this would fall into the category of FAIL.</p>
<p>Thus, SQL gives us the ability to <a href="http://www.indepthinfo.com/sql-dcl/grantstatement.php">GRANT</a> and <a href="http://www.indepthinfo.com/sql-dcl/revoke-statement-dcl.php">REVOKE</a>. Actually, on php myadmin in cpannel, you cannot do this with an SQL command, it is done through a UI when the user is created. Basically GRANT gives permission to do various things, and REVOKE takes those permissions away.</p>
<p>The system works logically in that a user has no permissions unless first granted them. Thus we have no REVOKEs without first, somewhere along the line, having a GRANT. The key to GRANTs is to keep them to a minimum. The less access users have to a database the less likely they are to screw things up. Of course, this must be balanced with the needs of the many, which Spock will tell you, out-weighs the needs of the few, we happy few, we band of brothers. Never thought you would see Spock and Henry V quoted in the same sentence did you? Suffice it to say there is a balance.</p>
<p>For most purposes, REVOKEs are used when an empolyee leaves a company or a user loses status (say a subscription lapses).  The syntax for REVOKE follows:</p>
<p>REVOKE privilege<br />
ON object<br />
FROM user or PUBLIC or role</p>
<p>For a GRANT, just replace &#8220;REVOKE&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/21/dcl-sql-grant-and-revoke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Nullification: IFNULL(), ISNULL(), NVL(), COALESCE()</title>
		<link>http://www.mcgelligot.com/2012/01/18/sql-nullification-ifnull-isnull-nvl-coalesce/</link>
		<comments>http://www.mcgelligot.com/2012/01/18/sql-nullification-ifnull-isnull-nvl-coalesce/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 20:15:47 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=474</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/18/sql-nullification-ifnull-isnull-nvl-coalesce/' addthis:title='SQL Nullification: IFNULL(), ISNULL(), NVL(), COALESCE()'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Okay, let&#8217;s get our act together. To find out if a cell is NULL why not just ask&#8230;ISNULL? Well, yes, this does work for mySQL. But it isn&#8217;t that simple. What if we wanted an easy way to replace the null value with something else? Good idea you say. So the powers that be at [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/18/sql-nullification-ifnull-isnull-nvl-coalesce/' addthis:title='SQL Nullification: IFNULL(), ISNULL(), NVL(), COALESCE()' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Okay, let&#8217;s get our act together. To find out if a cell is NULL why not just ask&#8230;ISNULL? Well, yes, this does work for mySQL. But it isn&#8217;t that simple. What if we wanted an easy way to replace the null value with something else? Good idea you say. So the powers that be at <a href="http://www.indepthinfo.com/sql-functions/ifnull-function-sql.php">mySQL came up with IFNULL(). </a>It looks like this:</p>
<p>SELECT IFNULL(column1, &#8220;alternative&#8221;) FROM table</p>
<p>So if the expression in column1 turns out to be NULL you can make it something else.</p>
<p>Where it gets a bit confusing is that some applications use ISNULL() the way mySQL uses IFNULL(). And some use a completely different syntax. NVL() is how it looks in Oracle.</p>
<p>But there is another way of doing this available in most applications. It is called COALESCE(). This looks alot like IFNULL (mySQL) but has the added feature that it can take multiple parameters and will in the end return the first one that it finds that is NOT NULL. So you can do something like this:</p>
<p>SELECT COALESCE(column1, column2, etc., &#8220;alternative&#8221;) FROM table</p>
<p>This will return the first not null param that it runs across. Leave the failsafe for the end.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/18/sql-nullification-ifnull-isnull-nvl-coalesce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All About SQL JOINs</title>
		<link>http://www.mcgelligot.com/2012/01/12/all-about-sql-joins/</link>
		<comments>http://www.mcgelligot.com/2012/01/12/all-about-sql-joins/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 21:42:44 +0000</pubDate>
		<dc:creator>mcgelligot</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.mcgelligot.com/?p=468</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.mcgelligot.com/2012/01/12/all-about-sql-joins/' addthis:title='All About SQL JOINs'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Normalization is a way to reduce the amount of time it takes for tables to do their processing. It involves reducing tables to the least number of necessary columns. However, this can create a problem when putting the data back together to present desired output. To solve this problem, JOINs were invented in SQL. In [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.mcgelligot.com/2012/01/12/all-about-sql-joins/' addthis:title='All About SQL JOINs' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Normalization is a way to reduce the amount of time it takes for tables to do their processing. It involves reducing tables to the least number of necessary columns. However, this can create a problem when putting the data back together to present desired output. To solve this problem, JOINs were invented in SQL. In a JOIN two columns from two tables are compared to find out if rows should be meshed together, then the rows are combined. It effectively makes one table an extension of another.</p>
<p><a href="http://www.mcgelligot.com/wp-content/uploads/2012/01/join-these-two-frogs.jpg"><img class="alignleft size-full wp-image-470" title="JOIN and UNION" src="http://www.mcgelligot.com/wp-content/uploads/2012/01/4024_bride_and_groom_frogs_cartoon_characters.jpg" alt="" width="300" height="168" /></a>For example, we have a list of customers and a list of transactions. We have a customer number for each customer and that customer number is listed in the transaction log. Since we already have all the info we need about our customers in the customer table, we do not need to also store it in the transaction log. All we need do is list the customer number. So when we need to send an invoice to a customer, we can perform a JOIN on the two tables. This will recall the transaction and with the reference to the customer table get the name, address, etc. Alternatively we could also use a JOIN to find all of the transactions by any specific customer.</p>
<p>For the NEWBIE there is a <a href="http://www.indepthinfo.com/sql-joins/">bewildering list of SQL JOINs</a>. Yet they all have a purpose:</p>
<p>First there is the INNER JOIN. This combines the information from two tables based on a comparison of two columns. It outputs only rows that are found in both tables.</p>
<p>A LEFT JOIN will output all the rows in the left table (or first) table and any associated info from the right table. If there is no info from the right, it will leave those cells blank.</p>
<p>The RIGHT JOIN is similar to the left, only in this case, it is all the rows on the RIGHT that will be listed with unfilled cells left blank.</p>
<p>A FULL JOIN is like a RIGHT and LEFT JOIN together. All rows are listed with the appropriate rows meshed. Blanks will be left in rows with unmeshed fields.</p>
<p>To confuse matters perhaps slightly, there is also the UNION. This works alot like a JOIN only it combines two SELECT statements rather than tables. The result is a list of all the unique info from two selections from like table columns.</p>
<p>Hope that clears things up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mcgelligot.com/2012/01/12/all-about-sql-joins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

