Hello guys, I'm trying to retrieve all records from a table an its
related models using findAll, which works fine but the query retrieves
all fields, so that I decided to use the fields parameter in findAll
method but it's not working: this is my code:
$fields = array('Appointment.id',
'Appointment.user_id',
'Appointment.created',
'User.name',
'User.lastname');
$data = $this->Appointment->findAll(null, $fields, 'Appointment.id',
20);
This is what I get:
Warning: mssql_query() [function.mssql-query]: message: Invalid column
name 'name'. (severity 16) in /var/www/apache2-default/infolab/cake/
libs/model/dbo/dbo_mssql.php on line 162
I'm using MSSQL as database, the relation between models are: An
appointment belongs to a user, and a user has many appointments. If I
don't pass $fields parameter the query executes well. What I'm I doing
wrong?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---