Hello,

I am getting an SQL syntax issue with the following:

$sort_order = 'Detail.user1+0 desc, Detail.keyword asc, Detail.user2+0
asc';

$this->Detail->findall("Detail.job_id = $job_id", '', $sort_order,
null, null, 1));

The error is in the Order By section of the sql that CakePHP
generates:

ORDER BY Detail`.`user1`+0 desc, `Detail`.`keyword` asc,
Detail`.`user2`+0 asc

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.

Thanks for any help.


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