Hi everyone, I state that I am not an expert so I apologize in advance if the question is not formulated correctly or worse, it is stupid.
I would need the values that I enter through the form (which in turn takes the values of the other models in each dropdownlist for each field) to be recorded also on each mtsql table of competence.
At the level of views the problem does not arise because everything works correctly, but on the mysql tables the values that should update on the basis of the form on which I select the various fields remain empty or do not update.
The problem is relative whether it is a count (how many times I have used a value in the form) or that it must report at least the ID of the value in the column of another mysql table.
I have a ‘managementpc’ table where I inserted the function:
public function addOs($insert, $changedAttributes){
if($insert){
$this->sistop->updateCounters(['qusistop' => 1]);
}
}
This function allows me to add, update the count in the column of the model ‘qusistop’ and in the view it works correctly.
I should enter a sql query command to do the same on the database too.
On the Yii guide, the case study of inserting values also on the column of the mysql table and not related to the database level, I have not found it and I cannot find ideas for this specific problem.
I think it’s an anomalous request and I don’t know if it’s feasible.
I kindly ask for your help.