<?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, part II</title>
	<atom:link href="http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Sat, 13 Mar 2010 15:19:16 +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/22/how-to-use-sql-functions-in-conditions-part-ii/comment-page-1/#comment-114354</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 10 Dec 2008 16:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comment-114354</guid>
		<description>@Petr: Thanks for your comment! Yes, you are right, this behavior has been changed in the meantime.</description>
		<content:encoded><![CDATA[<p>@Petr: Thanks for your comment! Yes, you are right, this behavior has been changed in the meantime.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Petr 'PePa' Pavel</title>
		<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/comment-page-1/#comment-114328</link>
		<dc:creator>Petr 'PePa' Pavel</dc:creator>
		<pubDate>Tue, 09 Dec 2008 13:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comment-114328</guid>
		<description>For those who missed the information, starting from CakePHP 1.2 it is no longer possible to use the magic tag -! in your condition to prevent your SQL function or keyword to be enclosed in quotes.

The recommended way now is to place it into the key or not make the array associative at all. It is no longer possible to put it into the value part of the definition.

Example here:
http://blog.pepa.info/php-html-css/cakephp/sql-functions-or-keywords-in-cakephp-conditions/</description>
		<content:encoded><![CDATA[<p>For those who missed the information, starting from CakePHP 1.2 it is no longer possible to use the magic tag -! in your condition to prevent your SQL function or keyword to be enclosed in quotes.</p>
<p>The recommended way now is to place it into the key or not make the array associative at all. It is no longer possible to put it into the value part of the definition.</p>
<p>Example here:<br />
<a href="http://blog.pepa.info/php-html-css/cakephp/sql-functions-or-keywords-in-cakephp-conditions/" rel="nofollow">http://blog.pepa.info/php-html-css/cakephp/sql-functions-or-keywords-in-cakephp-conditions/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/comment-page-1/#comment-88054</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sun, 11 May 2008 15:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comment-88054</guid>
		<description>@Mike: Hm, I think this is not supported by cake, at least I don&#039;t know a way to do that. So I would use Model::query() for this purpose. 

But you may also ask in the IRC channel and/or in the group, maybe there someone has a better solution.

Hope that helps!</description>
		<content:encoded><![CDATA[<p>@Mike: Hm, I think this is not supported by cake, at least I don&#8217;t know a way to do that. So I would use Model::query() for this purpose. </p>
<p>But you may also ask in the IRC channel and/or in the group, maybe there someone has a better solution.</p>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/comment-page-1/#comment-87953</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sat, 10 May 2008 23:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comment-87953</guid>
		<description>I was wondering if you could look at this behavior:
http://bin.cakephp.org/view/770559837

Even with adding &quot;-!&quot; before AES_ENCRYPT, it is still enclosing the query in quotes and not allowing the SQL function to execute. I can&#039;t seem to figure this one out. Thanks for any help you can provide.</description>
		<content:encoded><![CDATA[<p>I was wondering if you could look at this behavior:<br />
<a href="http://bin.cakephp.org/view/770559837" rel="nofollow">http://bin.cakephp.org/view/770559837</a></p>
<p>Even with adding &#8220;-!&#8221; before AES_ENCRYPT, it is still enclosing the query in quotes and not allowing the SQL function to execute. I can&#8217;t seem to figure this one out. Thanks for any help you can provide.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/comment-page-1/#comment-6680</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 23 May 2007 15:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comment-6680</guid>
		<description>@Diego: Hm, I think that is not possible, at least I am not aware of it.

@KireZ: It seems to be a bug in the version you use. I tried it with 1.2.0.5153 and it works fine.</description>
		<content:encoded><![CDATA[<p>@Diego: Hm, I think that is not possible, at least I am not aware of it.</p>
<p>@KireZ: It seems to be a bug in the version you use. I tried it with 1.2.0.5153 and it works fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KireZ</title>
		<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/comment-page-1/#comment-6678</link>
		<dc:creator>KireZ</dc:creator>
		<pubDate>Tue, 22 May 2007 21:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comment-6678</guid>
		<description>i tried your tricks but i couldnt make it work with something like this:

$this-&gt;User-&gt;findAll(array(&#039;CONCAT(&#039;m-&#039;,User.ID)&#039; =&gt; &#039;m-1532&#039;));

it loses the comma and i get mysql error 

SQl from the debug:

...
WHERE CONCAT(&#039;m-&#039; User.ID)=&#039;m-1532&#039;

if you notice the comma after &#039;m-&#039; is missing 

i couldn find a workaround. Can you give me some tip or this is some kind of bug in cake methods?

Thanks</description>
		<content:encoded><![CDATA[<p>i tried your tricks but i couldnt make it work with something like this:</p>
<p>$this-&gt;User-&gt;findAll(array(&#8216;CONCAT(&#8216;m-&#8217;,User.ID)&#8217; =&gt; &#8216;m-1532&#8242;));</p>
<p>it loses the comma and i get mysql error </p>
<p>SQl from the debug:</p>
<p>&#8230;<br />
WHERE CONCAT(&#8216;m-&#8217; User.ID)=&#8217;m-1532&#8242;</p>
<p>if you notice the comma after &#8216;m-&#8217; is missing </p>
<p>i couldn find a workaround. Can you give me some tip or this is some kind of bug in cake methods?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego</title>
		<link>http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/comment-page-1/#comment-6676</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Tue, 22 May 2007 16:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/22/how-to-use-sql-functions-in-conditions-part-ii/#comment-6676</guid>
		<description>I got one question, ¿Is it possible to generate a query like this one with in model-&gt;save? 
UPDATE Model SET Model.field = Model.field + 1;</description>
		<content:encoded><![CDATA[<p>I got one question, ¿Is it possible to generate a query like this one with in model-&gt;save?<br />
UPDATE Model SET Model.field = Model.field + 1;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
