Hi, I am facing some problem when deal with a realtionship tables, the record is not display :
// in Stock model: var $hasAndBelongsToMany = array( 'Category' => array( 'className' => 'Category', 'joinTable' => 'category', 'foreignKey' => 'stock_id', 'associationForeignKey' => category_id', 'with' => 'StockCategory', ), ); // in Stock controller: $selectedRecord = $this->Stock->StockCategory->find('list', array( 'fields'=>array('stock_id','category_id'), 'conditions'=>array('stock_id='.$this->Stock->id) ) ); $this->set(compact('selectedRecord')); I try to copy the SQL by using debug() to phpmysql, and i get 3 lines of records. but when i try to PRINT_R the $selectedRecord, i can only get 1 record, example: Array ( [1] => 4 ) Suppose the result have to be : Array ( [1] => 4 [1] => 7 [1] => 14 ) Values : 4,7,14 are category_id, [1] is stock_id. There is a table call "category" to store all the category name. Please point out whats wrong to my code or logic?? Thanks Best Regards. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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