probably need to wrap your strings in quotes (single or double)

Sam D

On Jan 27, 2008 12:48 PM, matches <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am getting a sql syntax error when I try the execute function. I
> errors when I try to use what I think to be the right syntax any other
> kind of experimental syntax ;)  Anyway, this is what I have:
>
> $this->User->execute("UPDATE users WHERE username = $username SET
> friends_list = concat(friends_list, $friendName)");
>
> I have also tried this:
>
> $this->User->execute("UPDATE 'users' WHERE 'username' = $username SET
> 'friends_list' = concat(friends_list, $friendName)");
>
> Here is the error:
>
> Query: UPDATE users WHERE username = joe SET friends_list =
> concat(friends_list, Albert2640)
> Warning: SQL Error: 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 'WHERE username = joe SET friends_list =
> concat(friends_list, Albert2640)' at line 1 in C:\xampp\htdocs\konimo
> \cake\libs\model\datasources\dbo_source.php on line 440
>
> Thanks for any help
>
>
> >
>



-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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