I'm working with a database that has 2 tables, processes and processmovements, I need to delete a data from the processes table, but the field ID of the process table is a foreing key in the table handlingprocesses. I am using PHP and MYSQL. p>
I'm working with a database that has 2 tables, processes and processmovements, I need to delete a data from the processes table, but the field ID of the process table is a foreing key in the table handlingprocesses. I am using PHP and MYSQL. p>
If the integrity rule is ON DELETE , you only need to execute the delete query as the data will also be deleted in the other table.
Here is an example of a deletion when the integrity rule is ON DELETE here .
If you'd like some help with the code, comment here.
If the answer was helpful, do not forget to mark it as answered.
This is happening because the data you are trying to delete is tied to the other table. Then you need to change or delete this data by removing the mooring (The field that is with the primary key of the data table MOVIMENTOPROCESSOS) and then deleting the data.