I have the following tables with these keys in my database:
session_id orders
sessions
session id course_id
course_id courses
I want to create a query to delete the entire date related to one course (course_id). For example, if I need to delete course_id = 10, I would like any sessions with the identifier course_id = 10 to be deleted, in addition, you must also delete any orders associated with any of these sessions.
Is it possible? What is the best way to approach him? (I am writing this in PHP.)
Any help is much appreciated!
source
share