<?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: Pagination of data from a HABTM relationship</title>
	<atom:link href="http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: 今週の管理人ブックマーク (8/28-9/4) - Sometime PHP</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-3/#comment-219514</link>
		<dc:creator>今週の管理人ブックマーク (8/28-9/4) - Sometime PHP</dc:creator>
		<pubDate>Sun, 04 Sep 2011 14:55:35 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-219514</guid>
		<description>[...] Pagination of data from a HABTM relationship &#8211; cakebaker [...]</description>
		<content:encoded><![CDATA[<p>[...] Pagination of data from a HABTM relationship &#8211; cakebaker [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-200809</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 19 May 2011 15:01:04 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-200809</guid>
		<description>@Gustavo: You are welcome :)</description>
		<content:encoded><![CDATA[<p>@Gustavo: You are welcome :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo Lizarraga</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-200222</link>
		<dc:creator>Gustavo Lizarraga</dc:creator>
		<pubDate>Thu, 12 May 2011 17:32:33 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-200222</guid>
		<description>Thanks dude!!, I have been handling with it for about 2 days, 
This solution helped me a lot, thanks...</description>
		<content:encoded><![CDATA[<p>Thanks dude!!, I have been handling with it for about 2 days,<br />
This solution helped me a lot, thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-195284</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Mon, 21 Mar 2011 15:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-195284</guid>
		<description>@David: I hope it was helpful for you...</description>
		<content:encoded><![CDATA[<p>@David: I hope it was helpful for you&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-195027</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 18 Mar 2011 19:41:32 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-195027</guid>
		<description>Looks like exactly what I&#039;m struggling for, will try that right now...

Thanks!!! I do think there should be an update from the official cakephp...</description>
		<content:encoded><![CDATA[<p>Looks like exactly what I&#8217;m struggling for, will try that right now&#8230;</p>
<p>Thanks!!! I do think there should be an update from the official cakephp&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-187411</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 11 Jan 2011 15:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-187411</guid>
		<description>@Vladislav: Good to hear you found a solution :)</description>
		<content:encoded><![CDATA[<p>@Vladislav: Good to hear you found a solution :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladislav</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-187313</link>
		<dc:creator>Vladislav</dc:creator>
		<pubDate>Mon, 10 Jan 2011 12:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-187313</guid>
		<description>Thank you! I&#039;ll try to test this solution.
But now I use other way ;-)

Additional field in &quot;product&quot; table - param with all param (duplicat, yep ;-(

For example - param is &quot;  1  3  5  &quot; (with two spaces before/after)
So SQL looks like:   .... LIKE &quot;% 3 % 5 %&quot; - and I take &quot;AND&quot; mode.

in speed comparing -  inner JOIN - X ms, LIKE mode - 0.1*X ms

Not so cute, but so fast ;-)</description>
		<content:encoded><![CDATA[<p>Thank you! I&#8217;ll try to test this solution.<br />
But now I use other way ;-)</p>
<p>Additional field in &#8220;product&#8221; table &#8211; param with all param (duplicat, yep ;-(</p>
<p>For example &#8211; param is &#8221;  1  3  5  &#8221; (with two spaces before/after)<br />
So SQL looks like:   &#8230;. LIKE &#8220;% 3 % 5 %&#8221; &#8211; and I take &#8220;AND&#8221; mode.</p>
<p>in speed comparing &#8211;  inner JOIN &#8211; X ms, LIKE mode &#8211; 0.1*X ms</p>
<p>Not so cute, but so fast ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-186318</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Fri, 31 Dec 2010 08:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-186318</guid>
		<description>@Vladislav: Good question. Here is a possible solution:
&lt;code&gt;
public $paginate = array(&#039;Product&#039; =&gt; array(&#039;limit&#039; =&gt; 2, &#039;conditions&#039; =&gt; array(
    &#039;Product.id IN (
        SELECT product_id 
        FROM categories_products 
        WHERE category_id = 1 
        AND product_id IN (
            SELECT product_id 
            FROM categories_products 
            WHERE category_id = 2
        )
    )&#039;
)));
&lt;/code&gt;

Hope that helps!</description>
		<content:encoded><![CDATA[<p>@Vladislav: Good question. Here is a possible solution:<br />
<pre><code>public $paginate = array('Product' =&gt; array('limit' =&gt; 2, 'conditions' =&gt; array(
    'Product.id IN (
        SELECT product_id 
        FROM categories_products 
        WHERE category_id = 1 
        AND product_id IN (
            SELECT product_id 
            FROM categories_products 
            WHERE category_id = 2
        )
    )'
)));</code></pre>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladislav</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-186096</link>
		<dc:creator>Vladislav</dc:creator>
		<pubDate>Tue, 28 Dec 2010 15:45:55 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-186096</guid>
		<description>Thank you for your help!

But here is some problem. With this solution we will take all Product. Who has category 1, or category 2...

But don&#039;t get Product who has only both category 1 &amp; 2. 

So - solution for select in &quot;OR&quot; mode - nice.
For &quot;AND&quot; mode - no. Any ideas? Can some one help me?</description>
		<content:encoded><![CDATA[<p>Thank you for your help!</p>
<p>But here is some problem. With this solution we will take all Product. Who has category 1, or category 2&#8230;</p>
<p>But don&#8217;t get Product who has only both category 1 &amp; 2. </p>
<p>So &#8211; solution for select in &#8220;OR&#8221; mode &#8211; nice.<br />
For &#8220;AND&#8221; mode &#8211; no. Any ideas? Can some one help me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/comment-page-2/#comment-167499</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Fri, 09 Jul 2010 14:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/#comment-167499</guid>
		<description>@Gideon: You are welcome!</description>
		<content:encoded><![CDATA[<p>@Gideon: You are welcome!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

