Hi at all!
I'm using i18n and i'm trying to search results with a form. But
cakephp creates a wrong query. I get the error below:
SQL Error: 1054: Unknown column 'Category.names' in 'where clause'

The query is:
SELECT `Category`.*, `I18n__name`.`content`, `Category`.`id` FROM
`categorys` AS `Category` LEFT JOIN `i18n` AS `I18n__name` ON
(`Category`.`id` = `I18n__name`.`foreign_key` AND `I18n__name`.`model`
= 'Category' AND `I18n__name`.`field` = 'name') WHERE
`Category`.`names` LIKE '%AAA%' AND `I18n__name`.`locale` = 'en';

But it should be:
SELECT `Category`.*, `I18n__name`.`content`, `Category`.`id` FROM
`categorys` AS `Category` LEFT JOIN `i18n` AS `I18n__name` ON
(`Category`.`id` = `I18n__name`.`foreign_key` AND `I18n__name`.`model`
= 'Category' AND `I18n__name`.`field` = 'name') WHERE
`I18n__name`.`content` LIKE '%AAA%' AND `I18n__name`.`locale` = 'en'

Note that the table name and the field name are wrong!

I think cakephp should create a wright query...

I hope you can help me...
Thank you very much!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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