<?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>Max Titov IV @ TechSplice &#187; sql</title>
	<atom:link href="http://www.blog.techsplice.com/archives/tag/sql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.blog.techsplice.com</link>
	<description>The most beautiful music of all is the music of what happens.</description>
	<lastBuildDate>Tue, 20 Dec 2011 18:56:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SQL: SELECT random number of rows</title>
		<link>http://www.blog.techsplice.com/archives/246</link>
		<comments>http://www.blog.techsplice.com/archives/246#comments</comments>
		<pubDate>Wed, 06 May 2009 19:17:19 +0000</pubDate>
		<dc:creator>maxtmax</dc:creator>
				<category><![CDATA[Everyday stuff]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.blog.techsplice.com/?p=246</guid>
		<description><![CDATA[Here&#8217;s a quick way of requesting a random number of rows from a MySQL database: SELECT * FROM &#60;tablename&#62; order by rand() limit &#60;n&#62;; tablename: is the name of the table you wish to access n: is thenumber of rows you wish to return Be careful though, don&#8217;t use this logic on a database with [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick way of requesting a random number of rows from a MySQL database:</p>
<pre class="prettyprint">SELECT * FROM &lt;tablename&gt; order by rand() limit &lt;n&gt;;</pre>
<p style="padding-left: 30px;"><em>tablename:</em> is the name of the table you wish to access</p>
<p style="padding-left: 30px;"><em>n:</em> is thenumber of rows you wish to return</p>
<p>Be careful though, <em>don&#8217;t</em> use this logic on a database with a large record, the performance will be unpleasant.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.techsplice.com/archives/246/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cyrilic integration of Flex and PHP</title>
		<link>http://www.blog.techsplice.com/archives/20</link>
		<comments>http://www.blog.techsplice.com/archives/20#comments</comments>
		<pubDate>Mon, 10 Dec 2007 02:57:23 +0000</pubDate>
		<dc:creator>maxtmax</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.blog.techsplice.com/?p=20</guid>
		<description><![CDATA[A recent project involved integration between a PHP content management tool like Joomla and Adobe Flex 2. I wrote a PHP script that parsed a MySQL database creating an XML structure that was then picked up by a HTTPService in a Flex application. The information in the database was stored in Cyrillic format, hence when [...]]]></description>
			<content:encoded><![CDATA[<p>A recent project involved integration between a <a href="http://uk.php.net/">PHP</a> content management tool like <a href="www.joomla.com">Joomla</a> and Adobe Flex 2. I wrote a <a href="http://uk.php.net/">PHP</a> script that parsed a <a href="http://www.mysql.com/">MySQL</a> database creating an <a href="http://www.xml.com/">XML</a> structure that was then picked up by a <a href="http://livedocs.adobe.com/flex/2/langref/mx/rpc/http/HTTPService.html">HTTPService</a> in a <a href="www.adobe.com/products/flex">Flex</a> application.</p>
<p>The information in the database was stored in <a href="http://en.wikipedia.org/wiki/Cyrillic_alphabet">Cyrillic</a> format, hence when ever I was loading the data in to the <a href="http://en.wikipedia.org/wiki/SWF">SWF</a> compiled file the end result was a collection of garbage data.  Setting the actuall HTML to <a href="http://en.wikipedia.org/wiki/Windows-1251">Windows-1251</a> encoding did not help the situation.</p>
<p>My following approach was to locate a native functionality within the <a href="www.adobe.com/products/flex">Flex</a> architecture to mediate the situation.  Unforchunately I wasn&#8217;t successful in aquiring sattisfying examples to solve the problem.  For that matter it became sadly obvious that I haven&#8217;t seen any flash pages using non/english alphabet [either I haven't been checking international sites that much or Adobe <a href="www.adobe.com/products/flex">Flex</a> isn't widely used overseas] .</p>
<p>My third approach was to look at the actual php code that was generating the <a href="http://www.xml.com/">XML</a> structure.  I&#8217;ve discovered a useful function <a href="http://php.net/mb_convert_encoding">mb_convert_encoding</a> that eventually solved my problems.  Using a simple snippet of code:</p>
<pre class="”prettyprint”">mb_convert_encoding($string_to_convert,'UTF-8','Windows-1251');</pre>
<p>I was able to convert the data from <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> in to <a href="http://en.wikipedia.org/wiki/Windows-1251">Windows-1251</a> which allowed me to display the desired <a href="http://en.wikipedia.org/wiki/Cyrillic_alphabet">Cyrillic</a> characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.techsplice.com/archives/20/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.885 seconds -->

