<?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>cakebaker &#187; tip</title>
	<atom:link href="http://cakebaker.42dh.com/tags/tip/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 20 Dec 2011 15:29:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quicktip: Exporting from a bare Git repository</title>
		<link>http://cakebaker.42dh.com/2009/08/06/quicktip-exporting-from-a-bare-git-repository/</link>
		<comments>http://cakebaker.42dh.com/2009/08/06/quicktip-exporting-from-a-bare-git-repository/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 13:37:30 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1228</guid>
		<description><![CDATA[Recently I had to export the latest version of a project from a bare Git repository. As it seems like there is no equivalent to svn export in Git, I had to look for an alternative. After some searching I found the following solution: $ cd ~/example.git $ git archive master &#124; tar -x -C [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to export the latest version of a project from a bare Git repository. As it seems like there is no equivalent to <a href="http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.export.html">svn export</a> in <a href="http://git-scm.com/">Git</a>, I had to look for an alternative. After some searching I found the following <a href="http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export/163769#163769">solution</a>:</p>
<pre>
<code>$ cd ~/example.git
$ git archive master | tar -x -C /path/to/target/folder</code>
</pre>
<p>The first part of this statement creates a tar archive with the content of the master branch. The second part then extracts this archive to the specified folder (-x means &#8220;extract&#8221;, and -C means &#8220;change to directory&#8221;).</p>
<p>I hope this is useful for some of you!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/08/06/quicktip-exporting-from-a-bare-git-repository/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RESTful routes and prefixes with CakePHP</title>
		<link>http://cakebaker.42dh.com/2009/04/22/restful-routes-and-prefixes-with-cakephp/</link>
		<comments>http://cakebaker.42dh.com/2009/04/22/restful-routes-and-prefixes-with-cakephp/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 08:34:31 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1169</guid>
		<description><![CDATA[Recently, I experimented a bit with RESTful routing in CakePHP. I wanted to have REST urls with a prefix. For example &#8220;/example/posts&#8221;, with &#8220;/example&#8221; as prefix. And so I added the following snippet to app/config/routes.php: Router::mapResources('Posts', array('prefix' =&#62; '/example')); Unfortunately, it doesn&#8217;t work, and you get a &#8220;Controller not found&#8221; error when requesting &#8220;/example/posts&#8221;, because [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I experimented a bit with RESTful routing in CakePHP. I wanted to have REST urls with a prefix. For example &#8220;/example/posts&#8221;, with &#8220;/example&#8221; as prefix. And so I added the following snippet to app/config/routes.php:</p>
<pre>
<code>Router::mapResources('Posts', array('prefix' =&gt; '/example'));</code>
</pre>
<p>Unfortunately, it doesn&#8217;t work, and you get a &#8220;Controller not found&#8221; error when requesting &#8220;/example/posts&#8221;, because CakePHP looks for an Example controller instead of a Posts controller. The same error occurs when I remove the leading slash from the prefix, like it is done with <a href="http://book.cakephp.org/view/46/Routes-Configuration#Prefix-Routing-544">&#8220;normal&#8221; prefix routing</a>:</p>
<pre>
<code>Router::mapResources('Posts', array('prefix' =&gt; 'example'));</code>
</pre>
<p>At this point I went to the source and found the reason, why it didn&#8217;t work: the prefix simply gets concatenated with the underscored controller name while Router::mapResources() generates the necessary routes for the resource. And this means, the prefix must contain a leading and a trailing slash:</p>
<pre>
<code>Router::mapResources('Posts', array('prefix' =&gt; '/example/'));</code>
</pre>
<p>Not really intuitive ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/04/22/restful-routes-and-prefixes-with-cakephp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Auto-loading vendor files (or any other file)</title>
		<link>http://cakebaker.42dh.com/2008/11/28/auto-loading-vendor-files-or-any-other-file/</link>
		<comments>http://cakebaker.42dh.com/2008/11/28/auto-loading-vendor-files-or-any-other-file/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 16:47:47 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[vendor]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=979</guid>
		<description><![CDATA[If you use classes which do not fit into CakePHP&#8217;s structure (i.e. they are no components, helpers, etc.), you have to import those classes manually with App::import(&#8216;Vendor&#8217;, &#8216;ClassName&#8217;), at least if your classes are in the &#8220;vendors&#8221; folder. This means, every time you want to use such a class, you first have to import it [...]]]></description>
			<content:encoded><![CDATA[<p>If you use classes which do not fit into CakePHP&#8217;s structure (i.e. they are no components, helpers, etc.), you have to import those classes manually with App::import(&#8216;Vendor&#8217;, &#8216;ClassName&#8217;), at least if your classes are in the &#8220;vendors&#8221; folder. This means, every time you want to use such a class, you first have to import it before you can use it. And that&#8217;s a bit of a pain ;-)</p>
<p>Fortunately, PHP5 provides a solution for this &#8220;problem&#8221;: auto-loading. The explanation from the <a href="http://www.php.net/manual/en/language.oop5.autoload.php">manual</a>: &#8220;You may define an __autoload function which is automatically called in case you are trying to use a class/interface which hasn&#8217;t been defined yet. By calling this function the scripting engine is given a last chance to load the class before PHP fails with an error.&#8221;</p>
<p>In CakePHP a good place for this function is app/config/bootstrap.php. The function to auto-load vendor files looks like:</p>
<pre>
<code>function __autoload($className) {
    App::import('Vendor', $className);
}</code>
</pre>
<p>If you want to use a custom function or a method of a class, you simply have to register your auto-load implementation. The example from above realized with a static method looks like:</p>
<pre>
<code>class AutoLoader {
    public static function load($className) {
        App::import('Vendor', $className);
    }
}

spl_autoload_register(array('AutoLoader', 'load'));</code>
</pre>
<p>You can find more information about auto-loading in the PHP manual: <a href="http://www.php.net/manual/en/language.oop5.autoload.php">Autoloading objects</a> and <a href="http://www.php.net/manual/en/function.spl-autoload-register.php">spl_autoload_register</a>.</p>
<p>Happy baking!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/11/28/auto-loading-vendor-files-or-any-other-file/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to remove the comment with the page execution time</title>
		<link>http://cakebaker.42dh.com/2008/09/04/how-to-remove-the-comment-with-the-page-execution-time/</link>
		<comments>http://cakebaker.42dh.com/2008/09/04/how-to-remove-the-comment-with-the-page-execution-time/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 07:06:56 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=784</guid>
		<description><![CDATA[If you look at the HTML source of pages generated with CakePHP, you will probably detect a comment with the page execution time after the &#60;/html&#62; tag that looks like: &#60;!-- 0.6885s --&#62; This comment is automatically added by Cake if the debug value in app/config/core.php is greater than 0. As long as you only [...]]]></description>
			<content:encoded><![CDATA[<p>If you look at the HTML source of pages generated with CakePHP, you will probably detect a comment with the page execution time after the &lt;/html&gt; tag that looks like:</p>
<pre>
<code>&lt;!-- 0.6885s --&gt;</code>
</pre>
<p>This comment is automatically added by Cake if the debug value in app/config/core.php is greater than 0. </p>
<p>As long as you only work with HTML in your views, this is no problem. But if you have to use a different format like <a href="http://www.json.org/">JSON</a>, you won&#8217;t love this comment and you have to get rid of it ;-)</p>
<p>There are two ways to accomplish this. </p>
<p>The first approach is to set the debug value to 0, for example in a single action, with:</p>
<pre>
<code>Configure::write('debug', 0);</code>
</pre>
<p>The other approach is to remove the code snippet which adds the comment with the page execution time. For this purpose open app/webroot/index.php, and at the end of the file remove the following code:</p>
<pre>
<code>if (Configure::read() &gt; 0) {
    echo "&lt;!-- " . round(getMicrotime() - $TIME_START, 4) . "s --&gt;";
}</code>
</pre>
<p>Happy baking!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/09/04/how-to-remove-the-comment-with-the-page-execution-time/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Loading optional functionality</title>
		<link>http://cakebaker.42dh.com/2008/08/11/loading-optional-functionality/</link>
		<comments>http://cakebaker.42dh.com/2008/08/11/loading-optional-functionality/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 15:48:53 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=687</guid>
		<description><![CDATA[Last week I introduced an optional feature to the OpenID component: if you want to use that feature you have to place a library in a certain folder. If there is no such library, the feature is not active. In plain PHP you could implement such a solution in the following way: if (file_exists('path_to_library_file')) { [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I introduced an optional feature to the OpenID component: if you want to use that feature you have to place a library in a certain folder. If there is no such library, the feature is not active. </p>
<p>In plain PHP you could implement such a solution in the following way:</p>
<pre>
<code>if (file_exists('path_to_library_file')) {
    include('path_to_library_file');
    use_library_function();
}</code>
</pre>
<p>In CakePHP, we usually use App::import() to load files. And as this method returns false if it can&#8217;t load the specified file, we can rewrite the snippet from above to:</p>
<pre>
<code>if (App::import('Vendor', 'library', array('file' =&gt; 'path_to_library_file'))) {
    use_library_function();
}</code>
</pre>
<p>Not really earth-shattering, but maybe it is helpful for some of you ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/08/11/loading-optional-functionality/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Loading vendor files</title>
		<link>http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/</link>
		<comments>http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 10:49:17 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[vendor]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/</guid>
		<description><![CDATA[The traditional way to load files from the &#8220;vendors&#8221; folders &#8212; using the vendor() function &#8212; has been deprecated a while ago in the development branch (you get a warning if you use this function). The new way is to use App::import(). To load a file named &#8220;example.php&#8221;, you have to use the following snippet: [...]]]></description>
			<content:encoded><![CDATA[<p>The traditional way to load files from the &#8220;vendors&#8221; folders &#8212; using the vendor() function &#8212; has been deprecated a while ago in the development branch (you get a warning if you use this function). </p>
<p>The new way is to use App::import(). To load a file named &#8220;example.php&#8221;, you have to use the following snippet:</p>
<pre>
App::import('Vendor', 'example');
</pre>
<p>Unfortunately, there&#8217;s a snag to it: it only works if the name is in lowercase, i.e. the following snippet <strong>won&#8217;t load</strong> the file &#8220;Example.php&#8221;:</p>
<pre>
App::import('Vendor', 'Example');
</pre>
<p>Instead you have to use:</p>
<pre>
App::import('Vendor', 'example', array('file' =&gt; 'Example.php'));
</pre>
<p>The second parameter can be any string except an empty string or null, but I don&#8217;t know what the meaning of this parameter is in this context&#8230;</p>
<p>The same also applies for folder names:</p>
<pre>
App::import('Vendor', 'example'.DS.'example'); // loads example/example.php
App::import('Vendor', 'example', array('file' =&gt; 'Example'.DS.'example.php')); // loads Example/example.php
</pre>
<p>It&#8217;s quite illogical, but according to some <a href="https://trac.cakephp.org/changeset/6600">newly added tests</a> it is supposed to work in this way&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Use a convention to structure your code</title>
		<link>http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/</link>
		<comments>http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 09:11:17 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/</guid>
		<description><![CDATA[One feature I like in Eclipse is the outline view which shows you the structure (i.e. the variables and methods) of the file you edit and allows you to jump quickly to those code elements (see image). To use this feature efficiently it makes sense to use a convention to structure your code (the example [...]]]></description>
			<content:encoded><![CDATA[<p>One feature I like in <a href="http://www.eclipse.org/pdt">Eclipse</a> is the outline view which shows you the structure (i.e. the variables and methods) of the file you edit and allows you to jump quickly to those code elements (see image). </p>
<p><img src='http://cakebaker.42dh.com/wp-content/uploads/2007/09/eclipse_outline.png' alt='Outline view' /></p>
<p>To use this feature efficiently it makes sense to use a convention to structure your code (the example in the image is unstructured hence it is more difficult to find a certain method). And even if your IDE doesn&#8217;t provide such a feature it makes sense to follow a convention as it makes your code more cleaner. </p>
<p>The convention I use is simple: first public stuff, then private stuff, both ordered alphabetically. So a CakePHP file may look like:</p>
<pre>
class A {
    var $a = ...
    var $z = ...
    var $__a = ...
    var $__z = ...

    function a() {}

    function z() {}

    function __a() {}

    function __z() {}
}
</pre>
<p>Especially if you have larger files it helps to avoid that you get a messy code structure. And it doesn&#8217;t require any additional effort. </p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/09/24/use-a-convention-to-structure-your-code/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Select distinct with CakePHP</title>
		<link>http://cakebaker.42dh.com/2007/07/25/select-distinct-with-cakephp/</link>
		<comments>http://cakebaker.42dh.com/2007/07/25/select-distinct-with-cakephp/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 08:53:27 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/07/25/select-distinct-with-cakephp/</guid>
		<description><![CDATA[Sometimes you have to use SELECT DISTINCT to get the desired records from the database. How can you use SELECT DISTINCT with CakePHP? The solution is rather simple: $this-&#62;User-&#62;findAll(null, 'DISTINCT User.city'); Or with the array syntax: $this-&#62;User-&#62;findAll(null, array('DISTINCT User.city')); Please notice that the keyword &#8220;DISTINCT&#8221; has to be uppercase, else you will get the following [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you have to use <a href="http://www.w3schools.com/sql/sql_select.asp">SELECT DISTINCT</a> to get the desired records from the database. How can you use SELECT DISTINCT with CakePHP? </p>
<p>The solution is rather simple:</p>
<pre>
$this-&gt;User-&gt;findAll(null, 'DISTINCT User.city');
</pre>
<p>Or with the array syntax:</p>
<pre>
$this-&gt;User-&gt;findAll(null, array('DISTINCT User.city'));
</pre>
<p>Please notice that the keyword &#8220;DISTINCT&#8221; has to be uppercase, else you will get the following error:</p>
<pre>
Unknown column 'distinct User.city'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/07/25/select-distinct-with-cakephp/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to use SQL functions in conditions, part II</title>
		<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/</link>
		<comments>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comments</comments>
		<pubDate>Tue, 22 May 2007 08:06:41 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/</guid>
		<description><![CDATA[In the original post &#8220;How to use SQL functions in conditions&#8221; I showed you how to use SQL functions in conditions by means of the magic &#8220;-!&#8221; marker with the following example: $this-&#62;User-&#62;findAll(array('DATE(User.modified)' =&#62; '-!CURDATE()')); This snippet returns all user records modified at the current day. Now John-Henrique asked in a comment how to do [...]]]></description>
			<content:encoded><![CDATA[<p>In the original post <a href="http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/">&#8220;How to use SQL functions in conditions&#8221;</a> I showed you how to use SQL functions in conditions by means of the magic &#8220;-!&#8221; marker with the following example:</p>
<pre>
$this-&gt;User-&gt;findAll(array('DATE(User.modified)' =&gt; '-!CURDATE()'));
</pre>
<p>This snippet returns all user records modified at the current day. Now <a href="http://vibemidia.com/blog/">John-Henrique</a> asked in a comment how to do the contrary, i.e. select those records not modified at the current day. </p>
<p>There exist at least two possible ways to accomplish this, the simplest one is to use &#8220;&lt;&gt;&#8221;:</p>
<pre>
$this-&gt;User-&gt;findAll(array('DATE(User.modified)' =&gt; '&lt;&gt; -!CURDATE()'));
</pre>
<p>It creates the following SQL code:</p>
<pre>
... WHERE DATE(`User`.`modified`) &lt;&gt; CURDATE()
</pre>
<p>Another approach is to use the &#8220;NOT&#8221; keyword of SQL:</p>
<pre>
$this-&gt;User-&gt;findAll(array('NOT' =&gt; array('DATE(User.modified)' =&gt; '-!CURDATE()')));
</pre>
<p>With this snippet we get the following SQL statement:</p>
<pre>
... WHERE NOT (DATE(`User`.`modified`) = CURDATE())
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to use SQL functions in conditions</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/</link>
		<comments>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comments</comments>
		<pubDate>Fri, 04 May 2007 15:24:14 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/</guid>
		<description><![CDATA[Sometimes it is handy to use a (database-specific) SQL function in your find/findAll statements, e.g. a function which returns the current date. But how can this be done? The obvious approach doesn&#8217;t work: $this-&#62;User-&#62;findAll(array('DATE(User.modified)' =&#62; 'CURDATE()')); The function &#8220;CURDATE()&#8221; is escaped and treated as a string as you can see in the generated SQL statement: [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is handy to use a (database-specific) SQL function in your find/findAll statements, e.g. a function which returns the current date. But how can this be done? </p>
<p>The obvious approach doesn&#8217;t work:</p>
<pre>
$this-&gt;User-&gt;findAll(array('DATE(User.modified)' =&gt; 'CURDATE()'));
</pre>
<p>The function &#8220;CURDATE()&#8221; is escaped and treated as a string as you can see in the generated SQL statement:</p>
<pre>
... WHERE DATE(`User`.`modified`) = 'CURDATE()'
</pre>
<p>To avoid the escaping we have to add the magical &#8220;-!&#8221; marker in front of the function name:</p>
<pre>
$this-&gt;User-&gt;findAll(array('DATE(User.modified)' =&gt; '-!CURDATE()'));
</pre>
<p>This will generate the expected SQL:</p>
<pre>
... WHERE DATE(`User`.`modified`) = CURDATE()
</pre>
<p>Hooray!</p>
<p>Thanks to Kabturek who mentioned this little trick some time ago in his <a href="http://kabturek.info/archive/2007/02/09">blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

