


<?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>Learn DooPHP &#187; database</title>
	<atom:link href="http://learn.doophp.com/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://learn.doophp.com</link>
	<description>Learn DooPHP - a high performance MVC based PHP framework</description>
	<lastBuildDate>Thu, 18 Aug 2011 19:47:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>(Deutsch) DooPHP Einsteiger-Tutorial</title>
		<link>http://learn.doophp.com/2011/08/deutsch-doophp-einsteiger-tutorial/</link>
		<comments>http://learn.doophp.com/2011/08/deutsch-doophp-einsteiger-tutorial/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 19:38:38 +0000</pubDate>
		<dc:creator>roman</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[doophp]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[introduction to doophp]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=247</guid>
		<description><![CDATA[<p>Alle, die auf der Suche nach einem Einsteiger-Tutorial für den Start mit DooPHP sind, finden hier eine einfache Anleitung zur Installation und Basis-Konfiguration einer typischen Webanwendung: <a title="DooPHP: Installation und Konfiguration (Anleitung)" href="http://realpr.de/doophp-installation-konfiguration-anleitung.html"><strong>DooPHP Installation und Konfiguration</strong></a></p>
]]></description>
		<wfw:commentRss>http://learn.doophp.com/2011/08/deutsch-doophp-einsteiger-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Profiling and DB Profiling with DooPHP</title>
		<link>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/</link>
		<comments>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 15:41:08 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Demos & Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db profiling]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=174</guid>
		<description><![CDATA[<p>If you have read the previous tutorial on <a href="http://learn.doophp.com/2009/12/using-doophp-logging-tools/">logging</a> you will find that <strong>profiling </strong>with DooPHP framework is relatively similar to the way you log messages.</p>
<p>Performance profiling can be used to measure the time &#38; memory needed for the specified code blocks and find out what the performance bottleneck is. Instead of calling log() you change it to<strong> beginProfile()</strong> and <strong>endProfile()</strong>. We need to mark the beginning and the end of each code block by inserting the following methods:</p>
<pre class="brush: php;">
Doo::logger()-&#62;beginProfile('block_id_here');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('block_id_here');
</pre>
<p>Code blocks need to be nested properly. A code block cannot intersect with another. It must be either at a parallel level or be completely enclosed by the other code block.</p>
<p>All of the profiled results can be organized in category, simply pass in another parameter at the end of the method beginProfile():</p>
<pre class="brush: php;">
//default category is 'application'
Doo::logger()-&#62;beginProfile('id', 'editpost');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('id');
</pre>
<p>To retrieve the profiled results, you called <strong>getProfileResult()</strong>. You have to pass in the block ID as parameter and you will get an associative array which shows you the time and memory used when processing the code block.</p>
<pre class="brush: php;">
Doo::logger()-&#62;beginProfile('block_id');
//...everything here will be profiled
Doo::logger()-&#62;endProfile('block_id');
$result = Doo::logger()-&#62;getProfileResult('block_id');
</pre>
<p>To view the profiled results, you just have to call showLogs(). By default it will return a neatly</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/12/profiling-and-db-profiling-with-doophp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing your database(s) with DooPHP</title>
		<link>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/</link>
		<comments>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 18:22:10 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[difficult]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=137</guid>
		<description><![CDATA[<p>This tutorial will demonstrate how to use the DooManageDb and DooUpdateDb classes to manage your projects database.</p>
<p>These classes have been developed to allow your application(s) to be independent of the database your users choose to use by allowing standard database definition to be used to define your database which is then translated into the SQL needed for the database engine the user is using. It also supports easy upgrading (and downgrading) of the database to allow for better version control support and rolling out of updates and unit testing.</p>
<p>In order to follow this tutorial you will need to use the latest version of DooPHP avaliable form the SVN repository (or version 1.3 or above &#8211; not out at the time of writing). The current implementation only supports MySQL and PgSQL at the moment so you will also need one of these 2 databases in order to follow the guide.</p>
<p>The first thing we need to do is to create a simple controller to run our tests from. Therefore create a new controller in your protected/controller/ folder. In this example I will use the controller &#8220;DatabaseController&#8221;. Now enter the following into the controller:</p>
<pre class="brush: php;">
&#60;?php
class DatabaseController extends DooController {

	public function updateDatabase() {

		echo '&#60;h1&#62;Update Database to Head&#60;/h1&#62;' . PHP_EOL;

		/* DB Updater</pre>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/10/managing-your-databases-with-doophp/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Using DooModel for Database Operations</title>
		<link>http://learn.doophp.com/2009/09/using-doomodel-for-database-operations/</link>
		<comments>http://learn.doophp.com/2009/09/using-doomodel-for-database-operations/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 18:30:31 +0000</pubDate>
		<dc:creator>Leng</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[DooModel]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=86</guid>
		<description><![CDATA[<p>If you have ever read DooPHP <a href="http://doophp.com/doc/guide/basic/model">guide</a> on model, you will see that a basic Model class does not have to extend any superclass.</p>
<p>A basic Model class looks like this:</p>
<pre class="brush: php;">
class User{
    public $id;
    public $uname;
    public $pwd;
    public $group;
    public $vip;

    public $_table = 'user';
    public $_primarykey = 'id';
    public $_fields = array('id', 'uname', 'pwd', 'group', 'vip');
}</pre>
<p>With the basic Model class, you can search for a database record by:</p>
<pre class="brush: php;">
//$this-&#62;db()-&#62;find('User');  is the same
Doo::db()-&#62;find('User');

//search for one record
Doo::db()-&#62;find('User', array('limit'=&#62;1) );

//search for a user named 'david'
Doo::db()-&#62;find('User', array('where'=&#62;&#34;uname='david'&#34;, 'limit'=&#62;1) );

//using prepared statement to avoid sql injection
Doo::db()-&#62;find('User', array(
                    'where' =&#62; 'user=?',
                    'param' =&#62; array($_GET['name']),
                    'limit' =&#62; 1
                )
           );

//Or simply use this for shorter code.
Doo::loadModel('User');
$u = new User;
$u-&#62;uname = $_GET['name'];
$result = Doo::db()-&#62;find($u, array('limit'=&#62;1));
</pre>
<p>Although the above code is pretty straightforward, we can make it even shorter and cleaner. First of all, we would need to have our Models to extend the DooModel class. We will have our Model class as the code below, notice the constructor:</p>
<pre class="brush: php; highlight: [14];">Doo::loadCore('db/DooModel');
class User extends DooModel {
    public $id;
    public $uname;
    public $pwd;
    public $group;
    public $vip;

    public $_table = 'user';
    public $_primarykey = 'id';
    public $_fields = array('id', 'uname', 'pwd', 'group', 'vip');

    function __construct(){
         parent::$className = __CLASS__;
    }
}
</pre>
<p>By</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/09/using-doomodel-for-database-operations/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Create a simple To Do List in DooPHP &#8211; Part 1</title>
		<link>http://learn.doophp.com/2009/09/create-a-simple-to-do-list-in-doophp-part-1/</link>
		<comments>http://learn.doophp.com/2009/09/create-a-simple-to-do-list-in-doophp-part-1/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 17:07:35 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[ORM]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://learn.doophp.com/?p=13</guid>
		<description><![CDATA[<h2>Introduction</h2>
<p>This tutorial will guide you through all the steps required to get started using DooPHP through the creation of a simple To Do List Application. The tutorial is split into a number of sections and you will need to read the guide from the begining in order to understand whats going on.</p>
<ul>
<li><strong>Part 1 &#8211; Getting Started</strong></li>
<li><a href="http://learn.doophp.com/2009/09/create-a-simple-to-do-list-in-doophp-part-2/">Part 2 &#8211; The Signup Form</a></li>
<li>Part 3 &#8211; User Authentication &#8211; Coming Soon</li>
<li>Part 4 &#8211; The To Do List &#8211; Coming Soon</li>
<li>Part 5 &#8211; Adding AJAX Functionality &#8211; Coming Soon</li>
</ul>
<h2>Our Objective for this Tutorial</h2>
<p>In this tutorial we will be creating a simple To <em>Doo</em> List Manager Web Application and through the course of the tutorial we will be covering the following topics:</p>
<ul>
<li>Obtaining and Deploying the Base DooPHP Application</li>
<li>Setting up the MySQL Database</li>
<li>Creating the Models</li>
<li>Creating the To Do Manager Application
<ul>
<li>Signup Form</li>
<li>User Authentication</li>
<li>User Home Page</li>
<li>Task Actions</li>
<li>Enhancing you application with AJAX</li>
</ul>
</li>
</ul>
<p>You can view a demo of the finished project <a title="View a demo of the DooPHP Tutorial To Do List Application" href="http://doophp.com/demo/" target="_blank">here</a>. Some screen shots of the final application are also included below:</p>
<p>TODO: IMAGES TO GO IN HERE WHEN I FINISH!</p>
<p>TODO: UPDATE THE DEMO LINK ABOVE</p>
<p><span id="more-13"></span></p>
<h2>Obtaining and Deploying the Base DooPHP Application</h2>
<p>Before you can begin working on the To Doo List Manager you will need access to a Web Server. This guide assumes you already have webhosting or better yet</p>]]></description>
		<wfw:commentRss>http://learn.doophp.com/2009/09/create-a-simple-to-do-list-in-doophp-part-1/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
