Iam using Cakephp 1.1

My controller code for search.In first page iam getting the search result,
but when i click on the next page iam getting full record, ( because it is
not getting inside the condition). How can i solve this problem.


        if(!empty($this->data['PotentialSubscriber']['first_name']))  {
                $myCond .= " and first_name like
'".$this->data['PotentialSubscriber']['first_name']."%'";

        }
        if(!empty($this->data['PotentialSubscriber']['last_name']))   {
            $myCond .= " and last_name like
'".$this->data['PotentialSubscriber']['last_name']."%'";
        }


        if (!$cond) {
            $cond = $myCond;
        } else {
            $cond = $myCond . ' AND ' . $cond;
        }


        $this->Pagination->ajaxAutoDetect = false;
        $this->Pagination->show = $this->adminperpage;
        list($order, $limit, $page) = $this->Pagination->init($cond);


        $data = $this->PotentialSubscriber->findAll($cond, NULL, $order,
$limit, $page);

        $this->set('users', $data);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to