Re: I have an ORM problem
Hi, all. Paul, I did your suggestion. I got the following: Book->Author->find('all')); } ?> Output *Parse error*: syntax error, unexpected T_STRING, expecting T_FUNCTION in * /var/www/relationship/app/controllers/books_controller.php* on line *3* Cheers -- M.S. Mónico Briseño Cortés Instructional Technologist Univ. Houston Moodle Teacher Certificate NTCM member Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
Re: I have an ORM problem
Martin. I got it. Thanks. This is the output of debug($books) Array ( [0] => Array ( [Book] => Array ( [id] => 3 [isbn] => 123456789 [title] => C programming [description] => C programming [author_id] => 1 ) ) ) Cheers -- M.S. Mónico Briseño Cortés Instructional Technologist Univ. Houston Moodle Teacher Certificate NTCM member Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
Re: I have an ORM problem
Paul, Structure of two tables CREATE TABLE `authors` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `name` varchar( 127 ) NOT NULL , `email` varchar( 127 ) NOT NULL , `website` varchar( 127 ) NOT NULL ); CREATE TABLE `books` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `isbn` varchar( 13 ) NOT NULL , `title` varchar( 64 ) NOT NULL , `description` text NOT NULL , `author_id` int( 11 ) NOT NULL ) How can I get the output from echo debug($books)? TIA -- M.S. Mónico Briseño Cortés Instructional Technologist Univ. Houston Moodle Teacher Certificate NTCM member Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
Re: I have an ORM problem
Hi, all. Thanks Paul, for your time to help me in this ORM stuff. No authors in Book find command. Models Controllers Author->recursive = 1; $authors = $this->Author->find('all'); $this->set('authors', $authors); } } ?> Book->recursive = 1; $books = $this->Book->find('all'); $this->set('books', $books); } } ?> Finally, yes books have authors No, I'm not using containable array. Cheers -- M.S. Mónico Briseño Cortés Instructional Technologist Univ. Houston Moodle Teacher Certificate NTCM member Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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