Sounds like Cake is trying to interpret this as a join table as part of HABTM 
(users -> details). Try renaming the table/model/controller/views structure to 
user_details.

Jeremy Burns
jeremybu...@me.com


On 22 Mar 2010, at 00:24, redcat wrote:

> I have a database table called users_details
> I have a model file called UserDetail.php with the following lines:
> 
> <?php
> class UserDetail extends AppModel {
>   var $name='UserDetail';
>   var $useTable='users_details';
>   }
> ?>
> 
> 
> 
> I have a controller file called users_details_controller.php with the
> following lines:
> <?php
> class UsersDetailsController extends AppController {
>     var $name = 'Users_Details';
>     function listusers() {
>         $this->set('users_details', $this->UserDetail-
>> find('all'));
>                     }
> }
> ?>
> 
> When I go to /app/user_details/listusers I get the following error:
> 
> Fatal error: Call to a member function find() on a non-object in /
> cakephp/app/controllers/users_details_controller.php on line 5
> 
> 
> Notice (8): Undefined property: UsersDetailsController::$UserDetail
> [APP/controllers/users_details_controller.php, line 5]
> 
> Now UserDetail model is there - I have even tried to use the variable
> useTable as you can see above.. yet why do I get this error of
> UserDetail being a "non-object"???
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> To unsubscribe from this group, send email to 
> cake-php+unsubscribegooglegroups.com or reply to this email with the words 
> "REMOVE ME" as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to