<?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>Programming Life</title>
	<atom:link href="http://blog.coding.ro/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.coding.ro</link>
	<description>Coding Through Life</description>
	<lastBuildDate>Fri, 13 Jan 2012 09:03:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>OSX Leopard on Compaq Presario A900</title>
		<link>http://blog.coding.ro/osx-leopard-on-compaq-presario-a900/</link>
		<comments>http://blog.coding.ro/osx-leopard-on-compaq-presario-a900/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 20:46:47 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[A900]]></category>
		<category><![CDATA[Compaq]]></category>
		<category><![CDATA[GMA x3100]]></category>
		<category><![CDATA[hackintosh]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[OSx86]]></category>
		<category><![CDATA[Presario]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=91</guid>
		<description><![CDATA[After a long weekend of trials and errors I&#8217;ve finally managed to properly install Leopard 10.5.6 on my laptop. I have Leopard on my desktop along side windows 7 and is running fast, really fast. Although I knew  from the start that installing on my Presarion A944 it will not be as easy as on [...]]]></description>
			<content:encoded><![CDATA[<p>After a long weekend of trials and errors I&#8217;ve finally managed to properly install Leopard 10.5.6 on my laptop.</p>
<p>I have Leopard on my desktop along side windows 7 and is running fast, really fast. Although I knew  from the start that installing on my Presarion A944 it will not be as easy as on the desktop I just couldn&#8217;t help it.</p>
<p>First of all the prerequisites for this adventure :</p>
<ol>
<li>iPc Leopard DVD (search your favorite torrent site for it)</li>
<li>One piece Compaq Presario A900 laptop (get it from wherever you prefer). Mine is A944CA.</li>
<li>A complete list of hardware items that your Presario has. Here is my list:</li>
</ol>
<ul>
<li>Intel GMA X3100 videocard</li>
<li>Intel ICH8 chipset</li>
<li>Atheros wireless card</li>
<li>Realteck RTL8139/810x network card</li>
<li>Conexant Audio</li>
</ul>
<p>OK. Here we go:</p>
<ol>
<li>Insert the DVD in the tray and boot the computer. Hit F9 when the message appears in order to change the boot priority and select the DVD.</li>
<li>After selecting the language for the installation, in the next screen open the disk utility.<br />
- select the HDD you want to use and choose &#8220;partition&#8221;<br />
- partition the disk as you like but in &#8220;options&#8221; area choose GUID (here you loose all data on the selected HDD so please be careful what you want)<br />
- select one partition and format it as Mac Journaled<br />
- close the disk utility</li>
<li>Hit Continue until you have the &#8220;Customize&#8221; button available, then hit &#8220;Customize&#8221;<br />
- Drivers &gt;&gt; Video &gt;&gt; Intel &gt;&gt; GMA x3100<br />
- Drivers &gt;&gt; Chipset &gt;&gt; Intel ICHxx<br />
- Drivers &gt;&gt; Audio &gt;&gt; Others &gt;&gt; Conexant<br />
- Drivers &gt;&gt; Ethernet &gt;&gt; RTL8139 (something similar, I can&#8217;t remember exactly the string)<br />
- Drivers &gt;&gt; Wireless &gt;&gt; Atheros (for some reason wireless is not working&#8230; yet, but I&#8217;m a persistent son of a &#8230; so I&#8217;ll post updates on that)<br />
- from fixes I only chose Keyboard PS2 as it seems not to work without it (no keyboard attached message)<br />
- hit &#8220;Continue&#8221; and the installation should go perfectly fine for&#8230; 10 minutes tops.</li>
<li>This is really important.<br />
After the installation is finished, after restart press any key at OSX boot, enter -x at the prompt and hit the return key. This will boot Leopard in safe mode.<br />
After completing the installation with all the required data (user name, pass, etc&#8230;)  you will have to perform a special trick to get the Video working in normal mode (as opposed to working only in safe mode).<br />
Navigate to System &gt; Library &gt; Extensions and remove 2 kexts (actually move them somewhere to have a backup):<br />
- AppleIntelIntegratedFramebuffer.kext<br />
- AppleIntelGMAX3100.kext</li>
<li>Restart the Computer</li>
<li>Enjoy</li>
</ol>
<p>What is not working:</p>
<p>- Video does not have QE support (not yet as far as I know)<br />
- Wireless not working (although I have an 80% sure bet on the reason&#8230; will investigate)</p>
<p>Everything else works as expected and  I&#8217;m actually quite please with the performance.</p>
<p>As a warning for the hackintosh newcomers: If you&#8217;ve never done this kind of testing installation before, find someone who did to help you out because you may have different hardware setup than I do and that would change step 3 completely. It&#8217;s always better to have someone experienced around the first time (yeah, that works for computers too <img src='http://blog.coding.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>For those of you that are really serious about the PC OSX business, <a href="http://www.osx86project.org/" target="_blank">http://www.osx86project.org/</a> is the place to find everything you need to know.</p>
<p>That being said, please don&#8217;t blame it on me is you lose your data or crush the computer.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fosx-leopard-on-compaq-presario-a900%2F&amp;title=OSX%20Leopard%20on%20Compaq%20Presario%20A900" id="wpa2a_2"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/osx-leopard-on-compaq-presario-a900/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedded Database For .NET</title>
		<link>http://blog.coding.ro/embedded-database-for-net/</link>
		<comments>http://blog.coding.ro/embedded-database-for-net/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 21:39:28 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[embed database]]></category>
		<category><![CDATA[Firebird]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=87</guid>
		<description><![CDATA[One of the major fights I had while making a jump from Delphi programming to C# and .NET was the one related to embedded databases. In Delphi there are many options and I&#8217;ve used most of them in my programming endeavors. On the other side, .NET  seems poor by comparison. However, I discovered that one [...]]]></description>
			<content:encoded><![CDATA[<p>One of the major fights I had while making a jump from Delphi programming to C# and .NET was the one related to <strong>embedded databases</strong>. In Delphi there are many options and I&#8217;ve used most of them in my programming endeavors. On the other side, .NET  seems poor by comparison. However, I discovered that one of the solutions I used with Delphi also supports .NET languages.</p>
<p><strong>Firebird</strong> project seems to have an embeddable library for .NET available. I&#8217;ve successfully used Firebird database in my Delphi projects in the past and it was the perfect solution for a client-server architecture I&#8217;ve developed.</p>
<p>This database engine has a strong community behind it and it&#8217;s  continuously developed further and further. Also, there are a lot of tools to manage firebird databases, some of them completely free. Deployment of a Firebird based application is simplified as the entire database is encapsulated in one single file and the actual DB engine consists of a single dll.</p>
<p>As a bonus, Firebird has one of the most relaxed license possible (basically you can use it for whatever purposes) <img src='http://blog.coding.ro/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  .</p>
<p>So, long story short,  for anybody looking for an embeddable database for .NET just check the <a title="Firebird" href="http://www.firebirdsql.org/" target="_blank">Firebird Project&#8217;s page </a> .</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fembedded-database-for-net%2F&amp;title=Embedded%20Database%20For%20.NET" id="wpa2a_4"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/embedded-database-for-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Loading and parsing XML from JavaScript using AJAX calls</title>
		<link>http://blog.coding.ro/loading-and-parsing-xml-from-javascript-using-ajax-calls/</link>
		<comments>http://blog.coding.ro/loading-and-parsing-xml-from-javascript-using-ajax-calls/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 21:10:12 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[loading XML]]></category>
		<category><![CDATA[parsing XML]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XMLHttpRequest]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=83</guid>
		<description><![CDATA[Loading and parsing XML from JavaScript using AJAX calls made easy.]]></description>
			<content:encoded><![CDATA[<p>Just the other day I was building a small in-place application/page and I needed to load some XML data using AJAX.</p>
<p>I&#8217;ll just post here the code as I believe a good example is better than a week of training.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p83code1'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p831"><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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
</pre></td><td class="code" id="p83code1"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//---- this function is a wrapper for XMLHttpRequest and is not mine (although I use it for years)</span>
<span style="color: #003366; font-weight: bold;">function</span> XHConn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> xmlhttp<span style="color: #339933;">,</span> bComplete <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span> xmlhttp <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Msxml2.XMLHTTP&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span> xmlhttp <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Microsoft.XMLHTTP&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span> xmlhttp <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> xmlhttp <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>xmlhttp<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">connect</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>sURL<span style="color: #339933;">,</span> sMethod<span style="color: #339933;">,</span> sVars<span style="color: #339933;">,</span> fnDone<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>xmlhttp<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	  bComplete <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	  sMethod <span style="color: #339933;">=</span> sMethod.<span style="color: #660066;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	  <span style="color: #000066; font-weight: bold;">try</span>
	  <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>sMethod <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;GET&quot;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		  xmlhttp.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>sMethod<span style="color: #339933;">,</span> sURL<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;?&quot;</span><span style="color: #339933;">+</span>sVars<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		  sVars <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">else</span>
		<span style="color: #009900;">&#123;</span>
		  xmlhttp.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>sMethod<span style="color: #339933;">,</span> sURL<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		  xmlhttp.<span style="color: #660066;">setRequestHeader</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Method&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;POST &quot;</span><span style="color: #339933;">+</span>sURL<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; HTTP/1.1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		  xmlhttp.<span style="color: #660066;">setRequestHeader</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Content-Type&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;application/x-www-form-urlencoded&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		xmlhttp.<span style="color: #660066;">onreadystatechange</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>xmlhttp.<span style="color: #660066;">readyState</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">4</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>bComplete<span style="color: #009900;">&#41;</span>
		  <span style="color: #009900;">&#123;</span>
			bComplete <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
			fnDone<span style="color: #009900;">&#40;</span>xmlhttp<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: #339933;">;</span>
		xmlhttp.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span>sVars<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span>
	  <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>z<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//---- we make a call to load categories.xml file found in the same folder as the current page</span>
<span style="color: #006600; font-style: italic;">//---- and we forward the response to be processed by a callback function called &quot;procGetCategories&quot;</span>
<span style="color: #003366; font-weight: bold;">function</span> getCategories<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> ajaxConn  <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> XHConn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
	sParams 	  <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
	ajaxConn.<span style="color: #660066;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://&quot;</span><span style="color: #339933;">+</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">hostname</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;/categories.xml&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;GET&quot;</span><span style="color: #339933;">,</span> sParams<span style="color: #339933;">,</span> procGetCategories<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> procGetCategories<span style="color: #009900;">&#40;</span>objReturn<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    xmlDoc <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">try</span> <span style="color: #006600; font-style: italic;">//Internet Explorer</span>
	<span style="color: #009900;">&#123;</span>
		xmlDoc <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Microsoft.XMLDOM&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		xmlDoc.<span style="color: #660066;">async</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;false&quot;</span><span style="color: #339933;">;</span>
		xmlDoc.<span style="color: #660066;">loadXML</span><span style="color: #009900;">&#40;</span>objReturn.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// all the others (Opera I'm not sure though .... never tested this on Opera)</span>
	<span style="color: #009900;">&#123;</span>
		parser <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> DOMParser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		xmlDoc<span style="color: #339933;">=</span>parser.<span style="color: #660066;">parseFromString</span><span style="color: #009900;">&#40;</span>objReturn.<span style="color: #660066;">responseText</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;text/xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> root <span style="color: #339933;">=</span> xmlDoc.<span style="color: #660066;">childNodes</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> catName<span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> catId<span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> x<span style="color: #339933;">=</span>root.<span style="color: #660066;">childNodes</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//---- categories node in my case</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>x.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">nodeType</span><span style="color: #339933;">==</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			catId   <span style="color: #339933;">=</span> x<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">childNodes</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">childNodes</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">nodeValue</span><span style="color: #339933;">;</span>
			catName <span style="color: #339933;">=</span> x<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">childNodes</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">childNodes</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//---- here you can do whatever you want with the received data. I chosed to create some buttons using &quot;createCategButton&quot; function</span>
			createCategButton<span style="color: #009900;">&#40;</span>catId<span style="color: #339933;">,</span> catName<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: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The code is quite simple and clear.<br />
Beware though, there is a size limit when it comes to the receiving data length (around 4000 characters) so either split the data in multiple files or manage the data on the JavaScript side.</p>
<p>Happy coding to all of you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/loading-and-parsing-xml-from-javascript-using-ajax-calls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lotto numbers PHP generator</title>
		<link>http://blog.coding.ro/lotto-numbers-php-generator/</link>
		<comments>http://blog.coding.ro/lotto-numbers-php-generator/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 07:58:32 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[6/49]]></category>
		<category><![CDATA[loto]]></category>
		<category><![CDATA[lotto]]></category>
		<category><![CDATA[number generator]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=17</guid>
		<description><![CDATA[A small search on Google showed me that most of the existent Lotto Number Generators are shareware, so I decided to write a tiny PHP script that does the basic job: ?View Code PHP1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 &#160; &#60;?php $generated = array&#40;&#41;; &#160; while [...]]]></description>
			<content:encoded><![CDATA[<p>A small search on Google showed me that most of the existent Lotto Number Generators are shareware, so I decided to write a tiny PHP script that does the basic job:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p17code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p173"><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" id="p17code3"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #000088;">$generated</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</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><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$generated</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$no</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mt_rand"><span style="color: #990000;">mt_rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">49</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: #339933;">!</span><a href="http://www.php.net/array_search"><span style="color: #990000;">array_search</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$no</span><span style="color: #339933;">,</span> <span style="color: #000088;">$generated</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
             <span style="color: #000088;">$generated</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$no</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; : &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$generated</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><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Flotto-numbers-php-generator%2F&amp;title=Lotto%20numbers%20PHP%20generator" id="wpa2a_6"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/lotto-numbers-php-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 2 IP using one NIC</title>
		<link>http://blog.coding.ro/ubuntu-2-ip-using-one-nic/</link>
		<comments>http://blog.coding.ro/ubuntu-2-ip-using-one-nic/#comments</comments>
		<pubDate>Mon, 19 May 2008 22:34:34 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[IP addresses]]></category>
		<category><![CDATA[network interfaces]]></category>
		<category><![CDATA[NIC]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ubuntu network configuration]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=16</guid>
		<description><![CDATA[While trying to set up a meteor server I stumble upon a small issue. I need it to access the same network card using 2 different IP addresses. My favorite linux distribution for server is Ubuntu Server, but as far as I know this should apply to all Linux distros. 1. Open for editing /etc/network/interfaces [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to set up a meteor server I stumble upon a small issue. I need it to access the same network card using 2 different IP addresses. My favorite linux distribution for server is Ubuntu Server, but as far as I know this should apply to all Linux distros.<br />
1. Open for editing /etc/network/interfaces  file using vim, Joe or mcedit.I used:</p>
<p><code># mcedit /etc/network/interfaces</code></p>
<p>2. Modify the content to look something like this, keeping in mind that these are the settings suitable for my environment. You should customize the ip addresses to match your network configuration:</p>
<p>#first address<br />
auto eth1<br />
iface eth1 inet static<br />
address 192.168.2.109<br />
netmask 255.255.255.0<br />
network 192.168.2.255<br />
gateway 192.168.2.1</p>
<p>#seccond address<br />
auto eth1:1<br />
iface eth1:1 inet static<br />
address 192.168.2.110<br />
netmask 255.255.255.0<br />
network 192.168.2.255<br />
gateway 192.168.2.1</p>
<p>3. Now restart the network</p>
<p><code># /etc/init.d/networking restart</code></p>
<p>4. Check the new configuration</p>
<p><code># ifconfig </code></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fubuntu-2-ip-using-one-nic%2F&amp;title=Ubuntu%202%20IP%20using%20one%20NIC" id="wpa2a_8"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/ubuntu-2-ip-using-one-nic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Confirmation Box</title>
		<link>http://blog.coding.ro/javascript-confirmation-box/</link>
		<comments>http://blog.coding.ro/javascript-confirmation-box/#comments</comments>
		<pubDate>Tue, 13 May 2008 14:54:03 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[confirm]]></category>
		<category><![CDATA[confirmation box]]></category>
		<category><![CDATA[confirmation dialog]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=15</guid>
		<description><![CDATA[JavaScript can display a nice confirmation box that will allow your script to test user&#8217;s choice when necessary. The JavaScript &#8220;confirm&#8221; result is of type boolean. The following example should clear things for you: ?View Code JAVASCRIPT1 2 3 4 5 6 7 8 9 10 var yesorno = confirm&#40;&#34;Do you like PHP?&#34;&#41;; &#160; if&#40; [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript can display a nice confirmation box that will allow your script to test user&#8217;s choice when necessary.</p>
<p>The JavaScript &#8220;confirm&#8221; result is of type boolean. The following example should clear things for you:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p15code5'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p155"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p15code5"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> yesorno <span style="color: #339933;">=</span> <span style="color: #000066;">confirm</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Do you like PHP?&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> yesorno <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;You like PHP, great...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Don't like it? Nobody cares anyway.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fjavascript-confirmation-box%2F&amp;title=JavaScript%20Confirmation%20Box" id="wpa2a_10"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/javascript-confirmation-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Leopard Leo4All on my PC</title>
		<link>http://blog.coding.ro/osx-leopard-leo4all-on-my-pc/</link>
		<comments>http://blog.coding.ro/osx-leopard-leo4all-on-my-pc/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 16:20:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[DG33BU]]></category>
		<category><![CDATA[E6850]]></category>
		<category><![CDATA[hackintosh]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[OSx86]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=14</guid>
		<description><![CDATA[Since the appearance of the Leopard version of the OSX operating system, I&#8217;ve been dying to install it on my PC. At the time I had an old Athlon CPU and I decided to get a cool new processor that would support the new OSX. In about a week I put together a nice little [...]]]></description>
			<content:encoded><![CDATA[<p>Since the appearance of the Leopard version of the OSX operating system, I&#8217;ve been dying to install it on my PC.</p>
<p>At the time I had an old Athlon CPU and I decided to get a cool new processor that would support the new OSX.</p>
<p>In about a week I put together a nice little computer with Intel E6850 + Intel DG33BU + GeForce 8600GT + 2 GB DDR2.</p>
<p>It took me months of testing and hacking and testing and crying and pulling my hair in my quest for Leopard. Finally, about 3 days ago I got my hands on Leo4All Leopard DVD ISO and that made my dream come true.  Everything works like a charm (and that means the things REALLY work, fast and glamorous).</p>
<p>I am no professional tester, nor do I use some complicated testing tools, yet, IMHO Leopard beats the crap out of Vista in many ways. Now I can understand those MAC junkies from various forums and blogs, bragging and  pretending theirs is the best OS  out there. I do not know about the &#8220;best&#8221; part, but  they do have a point on the looks, speed and feeling. Leopard provides all that to the fullest.</p>
<p>As a programmer though, I find Leopard to be unequipped by default with any programming tools (I mean there is not even a decent text editor). I tried to find a FREE text editor but I only found commercial ones. Finaly I got TextMate and it does the job just fine.</p>
<p>As a conclusion, I find Leopard to be a fine piece of software but definitely not targeted towards IT geeks but  more to the home user segment. For those of you spending night after night in front of the computer trying to make things work I would recommend Ubuntu (either server or desktop).</p>
<p>Here are some Screen shots :</p>
<p style="text-align: center;">
<a href="http://blog.coding.ro/images/1.png" target="_blank"><img style="vertical-align: top; border: 0;" src="http://blog.coding.ro/images/1.png" alt="Applications Folder" width="420" height="262" /></a>
</p>
<p style="text-align: center;">
<a href="http://blog.coding.ro/images/4.png" target="_blank"><img style="vertical-align: top; border: 0;" src="http://blog.coding.ro/images/4.png" alt="Amazing Leopard graphic performance" width="420" height="262" /></a></p>
<p style="text-align: center;">
<a href="http://blog.coding.ro/images/7.png" target="_blank"><img style="border: 0pt none; vertical-align: top;" src="http://blog.coding.ro/images/7.png" alt="iTunes" width="413" height="290" /></a></p>
<p style="text-align: center;">
<a href="http://blog.coding.ro/images/6.png" target="_blank"><img style="vertical-align: top;" src="http://blog.coding.ro/images/6.png" alt="About this mac" width="303" height="376" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fosx-leopard-leo4all-on-my-pc%2F&amp;title=OSX%20Leopard%20Leo4All%20on%20my%20PC" id="wpa2a_12"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/osx-leopard-leo4all-on-my-pc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How can we import data in MySQL from CSV file</title>
		<link>http://blog.coding.ro/how-can-we-import-data-in-mysql-from-csv-file/</link>
		<comments>http://blog.coding.ro/how-can-we-import-data-in-mysql-from-csv-file/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:19:36 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSV file]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[import data]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=13</guid>
		<description><![CDATA[Run this SQL script either from a mysql console or from your favorite scripting language (PHP, PERL&#8230;) LOAD DATA LOCAL INFILE &#8216;/path-to-file/dump_file.csv&#8217; INTO TABLE table_name FIELDS TERMINATED BY &#8216;,&#8217; LINES TERMINATED BY &#8216;\n&#8217; (Field_1, Filed_2, Field_3); I believe the syntax is more than clear so I won&#8217;t bother explaining too much.]]></description>
			<content:encoded><![CDATA[<p>Run this SQL script either from a mysql console or from your favorite scripting language (PHP, PERL&#8230;)</p>
<p>LOAD DATA LOCAL INFILE &#8216;/path-to-file/dump_file.csv&#8217;<br />
INTO TABLE table_name<br />
FIELDS TERMINATED BY &#8216;,&#8217;<br />
LINES TERMINATED BY &#8216;\n&#8217;<br />
(Field_1, Filed_2, Field_3);</p>
<p>I believe the syntax is more than clear so I won&#8217;t bother explaining too much.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fhow-can-we-import-data-in-mysql-from-csv-file%2F&amp;title=How%20can%20we%20import%20data%20in%20MySQL%20from%20CSV%20file" id="wpa2a_14"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/how-can-we-import-data-in-mysql-from-csv-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can we export MySQL data as CSV</title>
		<link>http://blog.coding.ro/how-can-we-export-mysql-data-as-csv/</link>
		<comments>http://blog.coding.ro/how-can-we-export-mysql-data-as-csv/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:12:23 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[MySQL dump]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=12</guid>
		<description><![CDATA[IN PHP: ?Download mysql2csv.txt1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 $table2dump = 'table_name'; $file_content = ''; &#160; $sql = &#34;SHOW COLUMNS FROM &#34; . $table2dump ; $res = mysql_query&#40;$sql&#41;; while &#40;$row = mysql_fetch_assoc&#40;$res&#41;&#41; &#123; $file_content .= $row&#91;'Field'&#93;.','; &#125; $file_content = substr&#40;$file_content, [...]]]></description>
			<content:encoded><![CDATA[<p>IN PHP:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.coding.ro/wp-content/plugins/wp-codebox/wp-codebox.php?p=12&amp;download=mysql2csv.txt">mysql2csv.txt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p127"><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
</pre></td><td class="code" id="p12code7"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$table2dump</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'table_name'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$file_content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SHOW COLUMNS FROM &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$table2dump</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_assoc"><span style="color: #990000;">mysql_fetch_assoc</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$file_content</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Field'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">','</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$file_content</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_content</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <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: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$table2dump</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_assoc"><span style="color: #990000;">mysql_fetch_assoc</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$file_content</span>  <span style="color: #339933;">.=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: application/vnd.ms-excel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-disposition: csv; filename=&quot;</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;_&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$table2dump</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.csv; size=&quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_content</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$file_content</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fhow-can-we-export-mysql-data-as-csv%2F&amp;title=How%20can%20we%20export%20MySQL%20data%20as%20CSV" id="wpa2a_16"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/how-can-we-export-mysql-data-as-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can you import(restore) a MySQL database from an SQL file</title>
		<link>http://blog.coding.ro/how-can-you-importrestore-a-mysql-database-from-an-sql-file/</link>
		<comments>http://blog.coding.ro/how-can-you-importrestore-a-mysql-database-from-an-sql-file/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 20:46:36 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[backup file]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sql file]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=11</guid>
		<description><![CDATA[From the shell command prompt type: mysql -p -h SERVER_NAME DATABASE_NAME < BACKUP_FILE.sql where: - SERVER_NAME &#8211; is the database server name (usually localhost) - DATABASE_NAME &#8211; is the name of the database to be restored - BACKUP_FILE &#8211; is the name of the file (usualy the name of the database plus the backup date)]]></description>
			<content:encoded><![CDATA[<p>From the shell command prompt type:</p>
<p>mysql -p -h SERVER_NAME DATABASE_NAME < BACKUP_FILE.sql</p>
<p>where:<br />
- SERVER_NAME &#8211; is the database server name (usually localhost)<br />
- DATABASE_NAME &#8211; is the name of the database to be restored<br />
- BACKUP_FILE &#8211; is the name of the file (usualy the name of the database plus the backup date)</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.coding.ro%2Fhow-can-you-importrestore-a-mysql-database-from-an-sql-file%2F&amp;title=How%20can%20you%20import%28restore%29%20a%20MySQL%20database%20from%20an%20SQL%20file" id="wpa2a_18"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/how-can-you-importrestore-a-mysql-database-from-an-sql-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

