Check that your Category model does not have an association defined for Freeone (probably a belongsTo association). Enjoy, John
On May 9, 10:11 am, Mike <tombaha...@gmail.com> wrote: > Hi everyone, i've got this problem: > Warning (512): SQL Error: 1054: Unknown column 'Category.freeone_id' > in 'on clause' [CORE\cake\libs\model\datasources\dbo_source.php, line > 525] > > The Categories table used to have 3 fields : id, user_id, freeone_id, > but i dropped the 'freeone_id' cause it was an useless field. > > Now i'm trying to retreieve the data from this talbe with this > sentence: > $this->Category->find('all',array('fields'=>array > ('Category.id','Category.name')) > > but i'm getting that error. I took a look at the cake-sql-log and the > sql query is: > SELECT `Category`.`id`, `Category`.`name` FROM `categories` AS > `Category` LEFT JOIN `freeones` AS `Freeone` ON > (`Category`.`freeone_id` = `Freeone`.`id`) WHERE 1 = 1 > > I just don't get why this happen..., my table changed but the sql > query didn't. > > Does anyone have an idea why this on clause appears?, there's any way > to fix my problem? > > thanks for your atention!! --~--~---------~--~----~------------~-------~--~----~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---