Re: Simple HABTM find results in SQL Error; Where's the problem?

2006-07-16 Thread gwoo

What version of mysql?

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



Re: Simple HABTM find results in SQL Error; Where's the problem?

2006-07-16 Thread [EMAIL PROTECTED]

3.26 something. I was checking requirements and it looks like this is
version of MySQL isn't supported. I'm on Media Temple by the way.


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



Simple HABTM find results in SQL Error; Where's the problem?

2006-07-15 Thread [EMAIL PROTECTED]

I have a simple app with 2 models (tags  scraps) with a join table.
Whenever I query the scraps I get a SQL error (I turned on debug level
2 to get this)

1064: You have an error in your SQL syntax near 'ON
`tagvat_scraps_tags`.`scrap_id` = '1' AND `tagvat_scraps_tags`.`tag_id`
= `Ta' at line 1

The SQL is this:

SELECT `Tag`.`id`, `Tag`.`name`, `Tag`.`created`, `Tag`.`modified` FROM
`tagvat_tags` AS `Tag` JOIN `tagvat_scraps_tags` ON
`tagvat_scraps_tags`.`scrap_id` = '1' AND `tagvat_scraps_tags`.`tag_id`
= `Tag`.`id` WHERE 1 = 1:

Is there actually an error here? If so, what happened?!

Thanks in advance!
Drew.


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



Re: Simple HABTM find results in SQL Error; Where's the problem?

2006-07-15 Thread [EMAIL PROTECTED]

I just added an 'INNER' before JOIN and the query works as expected.
Why does cake not specify the type of JOIN? Is this a bug?


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