Hi Xandornot
"query" is a method of the model class. Therefore you can't call
$this->query() in a controller. You have to call it via a model.
So if you model is User (to manage the users table), then you would do this:
$this->User->query("UPDATE users SET password = 'test' WHERE id = 25");
This does beg the question through of why you are not using save(), or
saveField() as they take away the pain of writing queries.
Regards,
Langdon
> $this->query("UPDATE users SET password = 'test' WHERE id = 25");
> I am using the previous in a controller, the controller returns a
> fatal error
> Fatal error: Call to undefined method UsersController::query()
>
> Does this not work in a controller??
> What other magic do I have to do?
>
> I hope someone can help, or I will just use a standard php mysql
> connection script and query, which will defeat the purpose of Cake. I
> am about ready to write this whole project from scratch. I have found
> that cake takes about 4 times as long to code, and if there is
> ANYTHING out of the cake's scope, I have to write it from scratch
> anyway.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---