tags:

views:

80

answers:

1

hi all,

let's say that i have 3 tables:

  1. books
  2. properties
  3. book_properties

of course, i would like that when i want to insert new book (or update existing), to fill the form.

fields that exist on form have to be defined as records in table properties.

when i fill up those fields, data has to be saved in table book_properties.

can you help me by giving some advices and references, how to achieve that?

thank you very much in advance!

A: 

You will need to create 3 tables: books (id, author, title, etc.), properties (id, name) and books_properties (id, book_id, property_id, property_value). Notice that the third table must be named *books_properties*, not *book_property*. Then you will need to create models for the books and properties tables. See the manual here. Create correct assosiations. Books HasAndBelongsToMany Properties. If you use cake console it will be easier to create models, controllers and views.

bancer