What is the relationship of the category and picture table? It seems that the pictures should possibly have a has one category and games has many pictures. When you look at the picture array, there is no category reference there. I would think there would need to be a category_id for it to be possible. Haven't had coffee yet so go easy.
On Aug 16, 7:27 am, Abraham Boray <abrahambo...@gmail.com> wrote: > Guys I'm lost, in the middle of a project I have to separate between > two pictures form > 1- Pictures 4 the iPhone > 2- Pictures 4 the Web > > I get this array from the controller by callin : > $this->Picture->recursive = 0; > $this->set('pictures', $this->paginate()); > > the array is a set of pictures and the GAME (to which they belong) > And every game have a CATEGORY > > Array > ( > [0] => Array > ( > [Picture] => Array > ( > [id] => 1 > [name] => Image_15.png > [type] => image/png > [size] => 328004 > [filesize] => 320 KB > [ext] => png > [group] => image > [path] => /files/iPhone/Image_15.png > [created] => 2010-08-02 16:19:33 > [modified] => 2010-08-02 16:19:33 > [type_id] => 30 > ) > ) > > [Game] => Array > ( > [0] => Array > ( > [id] => 9 > [game_name] => Game2 > [GamesPicture] => Array > ( > [id] => 43 > [game_id] => 9 > [picture_id] => 24 > ) > > [Category] => Array > ( > [id] => 3 > [name] => web > ) > ) > ) > ) > > So wot I want is to paginate this including just the web CATEGORY > PICTURES(Filtring) > WHERE CATEGORY.nam='web' > > I tried this but it'snot working : > /////////////////////////////////////////////////////////////////////////// > //////////// > $this->set('pictures', $this->paginate('conditions' => > array('Category.name' => 'web'))); > > this is the database structure so to get a clearer IDEA. > /////////////////////////////////////////////////////////////////////////// > //////////// > Field TABLE PICTURE > id > name > type > size > int(11) > filesize > group > type_id int(11) > > Field TABLE GAME > id > game_name > start_date > end_date > category_id > modified > > Field TABLE Games_pictures > id > game_id > picture_id > > Thank u guys 4 ur future help, I'm stuck and got really to get this > done as soon as I can Fix it > Thank u in advance > {A|B} 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