I have the exact problem as in this topic:
http://groups.google.com/group/cake-php/browse_thread/thread/1522701f158e90b8/a25f475b8f5230ee?lnk=gst&q=habtm+JOIN+query+error&rnum=2#a25f475b8f5230ee

-----
Query:
SELECT `State`.`id`, `State`.`name`, `State`.`abbr` FROM `states` AS
`State` JOIN `states_users` ON `states_users`.`user_id` = '1' AND
`states_users`.`state_id` = `State`.`id` WHERE 1 = 1

Result:
1064: You have an error in your SQL syntax near 'ON
`states_users`.`user_id` = '1' AND `states_users`.`state_id` =
`State`.`id` W' at line 10
-----

When testing Cake's generated query, adding "INNER" before the "JOIN"
makes the query work perfectly fine and the results return as
expected. I'm working with a somewhat older version of MySQL 4 and
there's not much prospect of updating (not my choice of web host). Is
there any way to get Cake to fix the query and add the needed "INNER"?

The manual says there's a "finder" query you can specify in the
$hasAndBelongsToMany instance array, but I can't find anywhere how to
actually write that, and I'm not even sure if that's what I need...

Any help would be greatly appreciated!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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