<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: MySQL Capitalize Function</title>
	<atom:link href="http://joezack.com/index.php" rel="self" type="application/rss+xml" />
	<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/</link>
	<description>Code Musings and Such</description>
	<lastBuildDate>Fri, 03 Feb 2012 02:11:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Stefano P</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1349</link>
		<dc:creator>Stefano P</dc:creator>
		<pubDate>Tue, 17 Jan 2012 10:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1349</guid>
		<description>Slightly modified version of your code, to capitalize first char only for words longer than X character.
Una versione leggermente modificata per considerare solo le parole più lunghe di X caratteri.

DELIMITER $$

DROP FUNCTION IF EXISTS Capitalize$$

CREATE FUNCTION Capitalize (InputString VARCHAR(255)) RETURNS VARCHAR(255) CHARSET utf8
BEGIN
	DECLARE Input_Length INT;
	DECLARE Count INT;
	DECLARE Last_Word INT;
	DECLARE Min_Char INT;
	
	SET Input_Length = CHAR_LENGTH(InputString);
	SET InputString = LOWER(InputString);
	SET Count = 0;
	SET Last_Word = 0;
	SET Min_Char = 3;
	
	WHILE (Count  Min_Char) THEN 
				SET InputString = CONCAT(	LEFT(InputString,Last_Word),
											UPPER(MID(InputString,Last_Word + 1,1)),
											RIGHT(InputString,Input_Length - Last_Word - 1));
			END IF;
			SET Last_Word = Count;
		END IF;
		SET Count = Count + 1;
	END WHILE;
	
	RETURN InputString;
END$$

DELIMITER ;</description>
		<content:encoded><![CDATA[<p>Slightly modified version of your code, to capitalize first char only for words longer than X character.<br />
Una versione leggermente modificata per considerare solo le parole più lunghe di X caratteri.</p>
<p>DELIMITER $$</p>
<p>DROP FUNCTION IF EXISTS Capitalize$$</p>
<p>CREATE FUNCTION Capitalize (InputString VARCHAR(255)) RETURNS VARCHAR(255) CHARSET utf8<br />
BEGIN<br />
	DECLARE Input_Length INT;<br />
	DECLARE Count INT;<br />
	DECLARE Last_Word INT;<br />
	DECLARE Min_Char INT;</p>
<p>	SET Input_Length = CHAR_LENGTH(InputString);<br />
	SET InputString = LOWER(InputString);<br />
	SET Count = 0;<br />
	SET Last_Word = 0;<br />
	SET Min_Char = 3;</p>
<p>	WHILE (Count  Min_Char) THEN<br />
				SET InputString = CONCAT(	LEFT(InputString,Last_Word),<br />
											UPPER(MID(InputString,Last_Word + 1,1)),<br />
											RIGHT(InputString,Input_Length &#8211; Last_Word &#8211; 1));<br />
			END IF;<br />
			SET Last_Word = Count;<br />
		END IF;<br />
		SET Count = Count + 1;<br />
	END WHILE;</p>
<p>	RETURN InputString;<br />
END$$</p>
<p>DELIMITER ;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hunter Monk</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1348</link>
		<dc:creator>Hunter Monk</dc:creator>
		<pubDate>Fri, 13 Jan 2012 18:20:56 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1348</guid>
		<description>This works perfectly, thanks!

It it possible to apply this to an entire column inside a table? In a table, I have a column with a string inside it, and I need to capitalize the first letter of every word.

Is this possible using your function?

Thanks,
Hunter</description>
		<content:encoded><![CDATA[<p>This works perfectly, thanks!</p>
<p>It it possible to apply this to an entire column inside a table? In a table, I have a column with a string inside it, and I need to capitalize the first letter of every word.</p>
<p>Is this possible using your function?</p>
<p>Thanks,<br />
Hunter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1333</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 26 Oct 2011 17:26:01 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1333</guid>
		<description>[...]  [...]</description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fungsi MySQL Huruf Kapital Pada Awal Kata &#187; Mangifero Scratchlog</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1317</link>
		<dc:creator>Fungsi MySQL Huruf Kapital Pada Awal Kata &#187; Mangifero Scratchlog</dc:creator>
		<pubDate>Thu, 25 Aug 2011 02:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1317</guid>
		<description>[...] Sumber        Tweet       Posted by admin at 9:41 am Tagged with: capitalize, function, mysql [...]</description>
		<content:encoded><![CDATA[<p>[...] Sumber        Tweet       Posted by admin at 9:41 am Tagged with: capitalize, function, mysql [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#1042;&#1080;&#1073;&#1088;&#1086;&#1087;&#1086;&#1075;&#1088;&#1091;&#1078;&#1072;&#1090;&#1077;&#1083;&#1100;</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1180</link>
		<dc:creator>&#1042;&#1080;&#1073;&#1088;&#1086;&#1087;&#1086;&#1075;&#1088;&#1091;&#1078;&#1072;&#1090;&#1077;&#1083;&#1100;</dc:creator>
		<pubDate>Mon, 04 Apr 2011 19:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1180</guid>
		<description>Hallo, Neat Post. Es gibt ein Problem mit Ihrer Website in Internet Explorer, w&#252;rde dies zu testen ... also noch ist der Marktf&#252;hrer und ein gro&#223;er Teil der Menschen wird Ihre wunderbare schriftlich wegen dieses Problems vermissen.</description>
		<content:encoded><![CDATA[<p>Hallo, Neat Post. Es gibt ein Problem mit Ihrer Website in Internet Explorer, w&#252;rde dies zu testen &#8230; also noch ist der Marktf&#252;hrer und ein gro&#223;er Teil der Menschen wird Ihre wunderbare schriftlich wegen dieses Problems vermissen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1104</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Mon, 15 Nov 2010 18:00:48 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1104</guid>
		<description>Great script.  Worked like a charm!  

For you guys that are getting the mysql error... 

The default delimiter in mysql is shown at the bottom of the sql query window as a semi-colon.  You have to change that.  Make it a tilde and the script will work perfectly.</description>
		<content:encoded><![CDATA[<p>Great script.  Worked like a charm!  </p>
<p>For you guys that are getting the mysql error&#8230; </p>
<p>The default delimiter in mysql is shown at the bottom of the sql query window as a semi-colon.  You have to change that.  Make it a tilde and the script will work perfectly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1103</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Mon, 15 Nov 2010 02:57:33 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1103</guid>
		<description>I&#039;m with Jools.. bombs on DECLARE len INT;

-- Nice effort though.</description>
		<content:encoded><![CDATA[<p>I&#8217;m with Jools.. bombs on DECLARE len INT;</p>
<p>&#8211; Nice effort though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Zack</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1091</link>
		<dc:creator>Joe Zack</dc:creator>
		<pubDate>Fri, 24 Sep 2010 22:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1091</guid>
		<description>No problem, glad I could help!</description>
		<content:encoded><![CDATA[<p>No problem, glad I could help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: d3ngar</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1090</link>
		<dc:creator>d3ngar</dc:creator>
		<pubDate>Fri, 24 Sep 2010 15:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1090</guid>
		<description>Thanks a lot for this. Really useful...

I hope you don&#039;t mind if I publish this on my blog too? I will link back to you, of course...</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this. Really useful&#8230;</p>
<p>I hope you don&#8217;t mind if I publish this on my blog too? I will link back to you, of course&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaime</title>
		<link>http://joezack.com/index.php/2008/10/20/mysql-capitalize-function/comment-page-1/#comment-1086</link>
		<dc:creator>Jaime</dc:creator>
		<pubDate>Fri, 23 Apr 2010 20:48:21 +0000</pubDate>
		<guid isPermaLink="false">http://joezack.com/?p=137#comment-1086</guid>
		<description>You are the man, I was testing another functions supposed to do this, and they was failing with non alfabetic characters</description>
		<content:encoded><![CDATA[<p>You are the man, I was testing another functions supposed to do this, and they was failing with non alfabetic characters</p>
]]></content:encoded>
	</item>
</channel>
</rss>

