In CakePHP, Is it possible to insert into another table with the other model not related to it? For example, I have a model Post .is it possible for me to use $this->Post->query(‘insert into tablename(col1) values (‘ . ‘$formname’ . ‘)’);
Suggest me the answer……
You could use the ‘uses’ var to specify the models you want to use in your controller:
This would tell the controller (in this case RecipesController) to use the User model as well as it’s default Model (Recipe). Now you can address $this->User as if you were in the UsersController.
Hope I understood your question correctly.
Tom