Guys, this is driving me mad... I have two models that are connected with the $hasMany and $belongsTo variables:
class Invoice extends AppModel { var $name = 'Invoice'; var $hasMany = array('InvoiceProduct'); } and class InvoiceProduct extends AppModel { var $name = 'InvoiceProduct'; var $belongsTo = array('Invoice'); function myFind() { return $this->find('all'); } } OK. Now in the InvoicesController I have this call: $things = $this->Invoice->InvoiceProduct->myFind(); Of cource, the myFind() is implemented in the InvoiceProduct model, for a simple examle: function myFind() { return $this->find('all'); } And it doesn't work. I get this message: Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'myFind' at line 1 When I click on the Warning and then on the context I get this: $sql = "myFind" $error = "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'myFind' at line 1" $out = null --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---