On Tue, Mar 15, 2011 at 12:59 AM, Mike Digital
<[email protected]> wrote:
> I've got two tables and a join table:
> * drink_reviews
> * comments
> * comments_drink_reviews
>
> I am trying to paginate on a specific category and here in lies the
> problem:
>
> ------------------------------------------------
> $this->Category->DrinkReview->bindModel(array('hasOne' =>
> array('CategoriesDrinkReview')));
> $this->paginate = array(
>  'conditions' => array(
>    'CategoriesDrinkReview.category_id' => $category['Category']['id']
>  ),
>  'limit' => 10
> );
> $reviews = $this->paginate('DrinkReview');
> ------------------------------------------------
>
> My pagination links (numbers, next, and previous) are all working
> correctly and I see that the initial COUNT in order to create the
> amount of pages is working correctly, but when it gets to the SELECT
> query to get the results, it's saying that it is not performing the
> join to the join table and therefor not selecting that table but still
> applying the "WHERE CategoriesDrinkReview.category_id = #"
>
> This is tremendously frustrating and if anyone can see any glaring,
> immediate issues, I would love to hear it. This join has been a bit of
> a jerk from the get-go, if I may be so honest.
>
> I'm running 1.3.3 but might try and upgrade to 1.3.7 in hopes for
> success.

Not sure where Comment comes into this. Typo?

Try this method:
http://www.littlehart.net/atthekeyboard/2007/12/11/cakephp-pagination-with-a-habtm-relationship

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to