Here is the code :

        $arrSqlConditions = array('id'=>$departmentId);
        $arrSqlFields = array('CollegeDepartment.name',
                              'Organization.user_id',
                              'Organization.name');
        $arrDepartmentOrganizations =
            $this->CollegeDepartment->find($arrSqlConditions,
                                           $arrSqlFields,
                                           null,
                                           2);

The above code caused this error :

SQL Error in model CollegeDepartment: 1054: Unknown column
'Organization.user_id' in 'field list'

Here is the code that works

        $arrSqlConditions = array('id'=>$departmentId);
        $arrSqlFields = null
        $arrDepartmentOrganizations =
            $this->CollegeDepartment->find($arrSqlConditions,
                                           $arrSqlFields,
                                           null,
                                           2);

It seems that you cannot specify fields when using habtm.  Does anyone
know if this is true?


--~--~---------~--~----~------------~-------~--~----~
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