Remove the "$id =" from the call to findUser()
On Fri, Feb 8, 2013 at 8:27 PM, Advantage+ <movepixels@gmail.com> wrote:
> I am having problems pulling User data in my plugin and cannot figure out
> why. If I run the same code in the controller it returns the data, but if I
> try to access it thru the model find method it fails.
>
>
>
> In the UserController:
>
>
>
> $model_find = $this->User->findUser($id =
> '510324ea-f78c-4ff6-a5e9-11c479ea19b9'); <- this results in
> Syntax error or access violation: 1064 You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the right
> syntax to use near 'findUser' at line 1
>
>
>
> Yet if I run the same code as in the findUser() in the controller directly
> it works as expected.
>
>
>
> /*$controller_find = $this->User->find('first', array(
>
> 'conditions' => array(
>
> 'User.id' =>
> '510324ea-f78c-4ff6-a5e9-11c479ea19b9')));*/
>
>
>
>
>
> UserModel:
>
>
>
> public function findUser($id){
>
> return $this->find('first', array(
>
> 'conditions' => array(
>
> 'id' => $id)));
>
> }
>
>
>
> Any ideas where I am going wrong here?
>
>
>
> Thanks,
>
>
>
> Dave
>
>
>
>
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Saturday, February 9, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment