Delete data from the database [closed]

-1

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>     

asked by anonymous 05.04.2018 / 18:41

2 answers

0

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.

    
05.04.2018 / 19:08
0

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.

    
05.04.2018 / 18:55