Delete data from Database

Asked

Viewed 53 times

-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

    What integration rule did you use in the relationship? ON UPDATE, ON DELETE ...?

  • I Utlizei on DELETE

  • 1

    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?

  • Oh yes, thank you very much, my doubt was more the way I will do.

  • If any response was helpful, mark as answered

2 answers

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.

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

You are not signed in. Login or sign up in order to post.