On Mon, Jul 21, 2008 at 1:07 AM, rtgwork <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am getting an SQL syntax issue with the following:
>
> $sort_order = 'Detail.user1+0 desc, Detail.keyword asc, Detail.user2+0
> asc';

What's with the "+0" business? Is this an attempt to cast to an int or
something? Does your query work if you omit those?

> You can see that CakePHP adds the ` characters within my $sort_order
> variable, but it doesn't add a beginning ` to the start of it.  So I
> get the syntax error.  I've tried manually adding a ` to $sort_order,
> but it doesn't work.  Any ideas how to fix this?  By the way, the
> query worked fine under Mysql4 but after migrating to Mysql5 it no
> longer works.
>

Does the query work if you use it directly (eg. in a terminal) with MySQL5.x?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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