<?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>My IT-blog &#187; PHP</title>
	<atom:link href="http://dev.eek.be/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.eek.be</link>
	<description>IT knowledge exchange</description>
	<lastBuildDate>Fri, 04 Jun 2010 05:34:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Backing up Mysql with Java and PHP</title>
		<link>http://dev.eek.be/2010/04/backing-up-mysql-with-java-and-php/</link>
		<comments>http://dev.eek.be/2010/04/backing-up-mysql-with-java-and-php/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 09:35:26 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://dev.eek.be/?p=310</guid>
		<description><![CDATA[mysqldump is an effective tool to backup MySQL databases. In normal cases, it&#8217;s done trough a command line commando but it can be used programmatically.
It&#8217;s a very easy script and it could be useful. (don&#8217;t have to log in into console to take a backup, create an auto backup on deployment, &#8230;)
It will work on [...]]]></description>
			<content:encoded><![CDATA[<p>mysqldump is an effective tool to backup MySQL databases. In normal cases, it&#8217;s done trough a command line commando but it can be used programmatically.<br />
It&#8217;s a very easy script and it could be useful. (don&#8217;t have to log in into console to take a backup, create an auto backup on deployment, &#8230;)<br />
It will work on Windows and Linux as long as mysql is in your PATH.</p>
<pre class="prettyprint">
package be.eek.test.mysql;

import java.io.IOException;
import java.io.InputStream;

public class MysqlBackup {

    /**
    main method is just to create a working example
    **/
    public static void main(String[] args) throws IOException {
        new MysqlBackup().MakeBackup();
    }

    public void MakeBackup() throws IOException {
        String dump = "mysqldump "      //Path to mysql
                + "--host=localhost "       //Mysql hostname
                + "--port=3306 "            //Mysql portnumber
                + "--user=root "            //Mysql username
                + "--password=test "        //Mysql password
                + "--add-drop-table "       //Add a DROP TABLE statement before each CREATE TABLE statement
                + "--add-drop-database "    //Add a DROP DATABASE statement before each CREATE DATABASE statement
                + "--complete-insert "      //Use complete INSERT statements that include column names.
                + "--extended-insert "      //Use multiple-row INSERT syntax that include several VALUES lists
                + "test";                   //Mysql databasename

        Process run = Runtime.getRuntime().exec(dump);

        InputStream in = run.getInputStream();

        int nextChar;
        StringBuffer sb = new StringBuffer();

        while ((nextChar = in.read()) != -1) {
            sb.append((char) nextChar);
        }

        //Here, you can for example write it to a file and save it
        System.out.println(sb);
    }
}
</pre>
<p>The same thing is also possible in php:</p>
<pre class="prettyprint lang-php">
$dump = "mysqldump "
        . "--host=localhost "       //Mysql hostname
        . "--port=3306 "            //Mysql portnumber
        . "--user=root "            //Mysql username
        . "--password=test "        //Mysql password
        . "--add-drop-table "       //Add a DROP TABLE statement before each CREATE TABLE statement
        . "--add-drop-database "    //Add a DROP DATABASE statement before each CREATE DATABASE statement
        . "--complete-insert "      //Use complete INSERT statements that include column names.
        . "--extended-insert "      //Use multiple-row INSERT syntax that include several VALUES lists
        . "test";                   //databasename

$backup = system($dump);
echo $backup;
die();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.eek.be/2010/04/backing-up-mysql-with-java-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; An introduction</title>
		<link>http://dev.eek.be/2009/11/php-an-introduction/</link>
		<comments>http://dev.eek.be/2009/11/php-an-introduction/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 13:06:08 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://dev.eek.be/?p=180</guid>
		<description><![CDATA[I had to give a presentation about PHP at my work earlier this year.
It was a quick and simple introduction about PHP and his features.
If you want to use this presentation by yourself, please leave me a comment.
odp-file
ppt-file
pptx-file
pdf-file


























]]></description>
			<content:encoded><![CDATA[<p>I had to give a presentation about PHP at my work earlier this year.<br />
It was a quick and simple introduction about PHP and his features.<br />
If you want to use this presentation by yourself, please leave me a comment.<br />
<a href="http://dev.eek.be/wp-content/uploads/2009/11/PHP-An-introduction.odp">odp-file</a><br />
<a href="http://dev.eek.be/wp-content/uploads/2010/04/PHP-An-introduction.ppt">ppt-file</a><br />
<a href="http://dev.eek.be/wp-content/uploads/2009/11/PHP-An-introduction.pptx">pptx-file</a><br />
<a href="http://dev.eek.be/wp-content/uploads/2009/11/PHP-An-introduction.pdf">pdf-file</a></p>
<p><img src="http://dev.eek.be/wp-content/uploads/2009/11/img0.png" alt="PHP-An introduction" title="PHP-An introduction" width="512" height="384" class="aligncenter size-full wp-image-186" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img1.png" alt="Agenda" title="Agenda" width="512" height="384" class="aligncenter size-full wp-image-188" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img2.png" alt="History of PHP" title="History of PHP" width="512" height="384" class="aligncenter size-full wp-image-190" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img3.png" alt="What is PHP" title="What is PHP" width="512" height="384" class="aligncenter size-full wp-image-191" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img4.png" alt="img4" title="img4" width="512" height="384" class="aligncenter size-full wp-image-192" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img5.png" alt="types" title="types" width="512" height="384" class="aligncenter size-full wp-image-193" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img6.png" alt="Variables" title="Variables" width="512" height="384" class="aligncenter size-full wp-image-194" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img7.png" alt="Predefined variables" title="Predefined Variables" width="512" height="384" class="aligncenter size-full wp-image-195" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img8.png" alt="Predefined variables" title="Predefined Variables" width="512" height="384" class="aligncenter size-full wp-image-196" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img9.png" alt="Predefined variables example" title="Predefined variables example" width="512" height="384" class="aligncenter size-full wp-image-197" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img10.png" alt="Variables - Scope" title="Variables - Scope" width="512" height="384" class="aligncenter size-full wp-image-198" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img11.png" alt="variable variables" title="variable variables" width="512" height="384" class="aligncenter size-full wp-image-199" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img12.png" alt="operators and control structures" title="operators and control structures" width="512" height="384" class="aligncenter size-full wp-image-200" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img13.png" alt="Functions" title="Functions" width="512" height="384" class="aligncenter size-full wp-image-201" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img14.png" alt="Classes and Objects" title="Classes and Objects" width="512" height="384" class="aligncenter size-full wp-image-202" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img15.png" alt="Constructors and destructors" title="Constructors and destructors" width="512" height="384" class="aligncenter size-full wp-image-203" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img16.png" alt="visibility" title="visibility" width="512" height="384" class="aligncenter size-full wp-image-204" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img17.png" alt="Scope resolution operator" title="Scope resolution operator" width="512" height="384" class="aligncenter size-full wp-image-205" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img18.png" alt="Abstract classes and interfaces" title="Abstract classes and interfaces" width="512" height="384" class="aligncenter size-full wp-image-206" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img19.png" alt="Abstract classes and interfaces" title="Abstract classes and interfaces" width="512" height="384" class="aligncenter size-full wp-image-207" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img20.png" alt="Magic methods" title="Magic methods" width="512" height="384" class="aligncenter size-full wp-image-208" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img21.png" alt="Reflection" title="Reflection" width="512" height="384" class="aligncenter size-full wp-image-209" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img22.png" alt="Popular PHP tools" title="Popular PHP tools" width="512" height="384" class="aligncenter size-full wp-image-210" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img23.png" alt="More info" title="More info" width="512" height="384" class="aligncenter size-full wp-image-211" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img24.png" alt="Questions??" title="Questions??" width="512" height="384" class="aligncenter size-full wp-image-212" /><br />
<img src="http://dev.eek.be/wp-content/uploads/2009/11/img25.png" alt="Contact" title="Contact" width="512" height="384" class="aligncenter size-full wp-image-213" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.eek.be/2009/11/php-an-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
