hi i have the following

class Tasklist extends AppModel
{
    var $name = 'Tasklist';
        var $belongsTo = array('Module','Task','User');

        function finddata() {

        return $this->query("SELECT `memberships`.`module_id`,
`memberships`.`user_id`, `tasks`.`id`as task_id
                                                                FROM 
`memberships` , `tasks`
                                                                WHERE 
`tasks`.`role_id` =  `memberships`.`role_id`");
        }
}

and

in Tasklist controller:
        function add() {

                $this->set('tasklists',$this->Tasklist->finddata());
                debug($tasklists);

}

The problem is this:

Notice: Undefined variable: tasklists in W:\www\cake\app\controllers
\tasklists_controller.php on line 23

Warning: Cannot modify header information - headers already sent by
(output started at W:\www\cake\app\controllers
\tasklists_controller.php:23) in W:\www\cake\cake\libs\controller
\controller.php on line 447


I am guessing that i am not passing the data from the model to the
controller in the correct way, so i would like some help on how to do
that correctly. I would like to call the save method from the
controller then, so as to insert the data retrieved by the query plus
some additional fields.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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