Home » Php » php – When deleting one category, then delete all posts under selected category

php – When deleting one category, then delete all posts under selected category

Posted by: admin February 25, 2020 Leave a comment

Questions:

i have category table and post table. Please check image from below
When I delete one category, I want to delete all post under that category.
Suppose I have one category named PHP and it has five posts. When I delete PHP category then it will delete all five posts uder PHP category. What will be exact query for that? How can I do that?

How to&Answers: