-1
I am working with a database that has 2 tables, processes and processes, need to delete a data from the processes table, but the ID field of the process table is a foreing key in the processes table. I am using PHP and MYSQL.
-1
I am working with a database that has 2 tables, processes and processes, need to delete a data from the processes table, but the ID field of the process table is a foreing key in the processes table. I am using PHP and MYSQL.
0
This is happening because the data you are trying to delete is tied with the other table. Then you need to change or delete this data by removing the mooring (The field that has the primary key from the MOVE table data processes) and then delete the data.
Okay, thanks for your help!
0
If the rule of integrity is ON DELETE, you just need to perform the delete query that data will also be deleted in the other table.
Follow an example of deletion when the integrity rule is ON DELETE here.
If you want help with the code , comment here.
If the answer was helpful, do not forget to mark as answered.
Browser other questions tagged php mysql database
You are not signed in. Login or sign up in order to post.
What integration rule did you use in the relationship? ON UPDATE, ON DELETE ...?
– Felipe
I Utlizei on DELETE
– Lucas Vilas Boas
Then you just need to do the delete query and run it. You want help with source code, or your question was just how the behavior would be?
– Felipe
Oh yes, thank you very much, my doubt was more the way I will do.
– Lucas Vilas Boas
If any response was helpful, mark as answered
– Felipe