<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to use SQL functions in conditions</title>
	<atom:link href="http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Sat, 13 Mar 2010 06:19:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-81053</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 08 Apr 2008 15:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-81053</guid>
		<description>@yunhaihuang: Your statement looks correct to me. You may also try the following statement:
&lt;pre&gt;
$this-&gt;Ad-&gt;findAllByCatId(3);
&lt;/pre&gt;
Hope that helps!</description>
		<content:encoded><![CDATA[<p>@yunhaihuang: Your statement looks correct to me. You may also try the following statement:</p>
<pre>
$this-&gt;Ad-&gt;findAllByCatId(3);
</pre>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yunhaihuang</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-80960</link>
		<dc:creator>yunhaihuang</dc:creator>
		<pubDate>Tue, 08 Apr 2008 07:12:08 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-80960</guid>
		<description>how to return record from two join tables.
example:
cats(id, name_de)
ads(id, title_de, cat_id)
i want to retrieve the data from two above table, how do i do it?
$temp=$this-&gt;Ad-&gt;Cat-&gt;execute(&quot;SELECT  title_de, name_de   FROM ads, cats WHERE cats.id=ads.cat_id and cat_id=3&quot;);
if i do this, i only return the value of &quot;cat.name_de&quot;, don&#039;t return the &quot;ad.title_de&quot;
array ( [0] =&gt; Array ( [Cat] =&gt; Array ( [name_de] =&gt; 123456 ) ) [1] =&gt; Array ( [Cat] =&gt; Array ( [name_de] =&gt; 123456 ) ) )</description>
		<content:encoded><![CDATA[<p>how to return record from two join tables.<br />
example:<br />
cats(id, name_de)<br />
ads(id, title_de, cat_id)<br />
i want to retrieve the data from two above table, how do i do it?<br />
$temp=$this-&gt;Ad-&gt;Cat-&gt;execute(&#8220;SELECT  title_de, name_de   FROM ads, cats WHERE cats.id=ads.cat_id and cat_id=3&#8243;);<br />
if i do this, i only return the value of &#8220;cat.name_de&#8221;, don&#8217;t return the &#8220;ad.title_de&#8221;<br />
array ( [0] =&gt; Array ( [Cat] =&gt; Array ( [name_de] =&gt; 123456 ) ) [1] =&gt; Array ( [Cat] =&gt; Array ( [name_de] =&gt; 123456 ) ) )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yunhaihuang</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-80959</link>
		<dc:creator>yunhaihuang</dc:creator>
		<pubDate>Tue, 08 Apr 2008 07:07:58 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-80959</guid>
		<description>how to return record from two join tables.</description>
		<content:encoded><![CDATA[<p>how to return record from two join tables.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-7811</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 26 Jul 2007 09:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-7811</guid>
		<description>@Gil: I don&#039;t know when the &#039;-!&#039; marker was introduced, but it should work with the current releases.</description>
		<content:encoded><![CDATA[<p>@Gil: I don&#8217;t know when the &#8216;-!&#8217; marker was introduced, but it should work with the current releases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gil Vidals</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-7793</link>
		<dc:creator>Gil Vidals</dc:creator>
		<pubDate>Tue, 24 Jul 2007 23:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-7793</guid>
		<description>The &#039;-!&#039; did not work for me. I wonder what version of CakePHP is required for the &#039;-!&#039; to work.</description>
		<content:encoded><![CDATA[<p>The &#8216;-!&#8217; did not work for me. I wonder what version of CakePHP is required for the &#8216;-!&#8217; to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-6669</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Mon, 21 May 2007 16:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-6669</guid>
		<description>@John-Henrique: The following snippet should do the trick:
&lt;pre&gt;
$this-&gt;User-&gt;findAll(array(&#039;not&#039; =&gt; array(&#039;DATE(User.modified)&#039; =&gt; &#039;-!CURDATE()&#039;)));
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@John-Henrique: The following snippet should do the trick:</p>
<pre>
$this-&gt;User-&gt;findAll(array('not' =&gt; array('DATE(User.modified)' =&gt; '-!CURDATE()')));
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: John-Henrique</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-6645</link>
		<dc:creator>John-Henrique</dc:creator>
		<pubDate>Sat, 19 May 2007 14:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-6645</guid>
		<description>Ok, but how do negative condition?

&quot;WHERE DATE(`User`.`modified`) != CURDATE()&quot;

????

Sorry for small english, thaks!</description>
		<content:encoded><![CDATA[<p>Ok, but how do negative condition?</p>
<p>&#8220;WHERE DATE(`User`.`modified`) != CURDATE()&#8221;</p>
<p>????</p>
<p>Sorry for small english, thaks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MP:Schorsch</title>
		<link>http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/comment-page-1/#comment-6427</link>
		<dc:creator>MP:Schorsch</dc:creator>
		<pubDate>Sat, 05 May 2007 01:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/#comment-6427</guid>
		<description>nice little syntax hint :-)</description>
		<content:encoded><![CDATA[<p>nice little syntax hint :-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
