Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion pagination problem, please help
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ivan Rimac  
View profile  
 More options Nov 18 2012, 4:52 pm
From: Ivan Rimac <ivn...@gmail.com>
Date: Sun, 18 Nov 2012 22:51:33 +0100
Local: Sun, Nov 18 2012 4:51 pm
Subject: Re: pagination problem, please help

i think this is your answer:

function category($id = null){

    if($this->is_user()) {
     $this->set('user_obj', $user =
$this->User->findById($this->user['id']));
    }

    $category = $id;
    $cat_id = array_search($category,
Configure::read('Blog.blog_category'));

    $this->paginate = array('Blog' => array('conditions' =>
array('Blog.categories' => $cat_id), 'limit' => 12, 'recursive' => -1));
    $blogs = $this->paginate('Blog');

    $this->set(compact('blogs', 'category'));
    }

On Sun, Nov 18, 2012 at 9:05 PM, Chris <chris...@yahoo.com> wrote:
> hi guys,... I have a problem with pagination in a controller,... can
> someone help me please,...
> I'm getting an error: SQL Error: 1054: Unknown column 'limit' in 'where
> clause'

> how can I do this,...?

>   function category($id = null)
>   {
>     if($this->is_user())
>     {
>       $this->set('user_obj', $user =
> $this->User->findById($this->user['id']));
>     }

>       $category = $id;

>       $cat_id = array_search($category,
> Configure::read('Blog.blog_category'));

>       $this->set('category', $category);

>       $blogs = $this->Blog->find('all', array('conditions' =>
> array('Blog.categories' => $cat_id)));

>       $this->set('blogs', $blogs, $this->paginate('Blog', array('limit' =>
> 12) ));

> thanks in advance,
> chris

>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP

> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.

--
*Ivan Rimac***
mail: ivn...@gmail.com
*tel: +385 95 555 99 66*
*http://ivanrimac.com*

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.