i have a simple form with two input fields and i would like to save the data from one field inside one table and the other one inside the second table.
to save the data i use $this->Room->save($this->data)
any ideas how this can be done?
thanks
edit:
one is rooms the other one is roomates the common key i want to use is is id_rooms and id_roomates
For
Roombuild an array like below. It is just an example, set it according to your actual fields.Then save data to room table:
$this->Room->save($this->data).Next build an array for second table, say
Roomtitle, as below:and save it:
$this->Roomtitle->save($this->data).