Do I need to set foreign keys (author_id, book_id) to the tables (books, authors)? How do I make my views have multiple selection fields and how do I store them (because they're in an array)?
On Aug 7, 10:15 am, Robert P <shiftyrobs...@gmail.com> wrote: > Well, if Books can have more than one Author in your system then it's: > Authors hasAndBelongsToMany Books > Books hasAndBelongsToMany Authors > > But if each book can only have one Author then it would be: > Authors hasMany Books > Book belongsTo Author > > with the foreign keys set up as required. > > Please read the Cookbook > -http://book.cakephp.org/view/78/Associations-Linking-Models-Together > > On Aug 7, 8:29 am,Rawna<asumaw...@gmail.com> wrote: > > > On Aug 7, 2:48 am, Vijay Kumbhar <k.vidn...@gmail.com> wrote: > > > > Better way please create new table that will take the book_id & the > > > auther_id so that you can associate the models. > > > What Model relationship should I do to create that? Could you please > > give an example? > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---