To delete records which has 1-2-m relationship
Posted: Mon Apr 14, 2003 7:39 am
Hello everybody,
I need some advice with one of my tasks.Here it goes....
I've got 3 tables(Topics, Subtopics, Articles) which are related to each other.
Each Topic has many Subtopics and each Subtopic has got many articles.
I want to design a form inorder to delete either a topic or a subtopic or an article.
Well, I've written a piece of code in order to delete the articles and its working fine.
What happens if I directly delete the subtopics though there are some articles exsisting under them??and similary with the topics if there are some sub-topics under their belt.
If this is gonna happen, I think the system will not be a stable one.My articles table look like(Article_id, Subtopic_id, Topic_id, Article_name Article_file, Article_keyword)
How best can I do inorder to make the system stable so that I can be able to delete a topic or a sub-topic or an article.
Thanks in advance
I need some advice with one of my tasks.Here it goes....
I've got 3 tables(Topics, Subtopics, Articles) which are related to each other.
Each Topic has many Subtopics and each Subtopic has got many articles.
I want to design a form inorder to delete either a topic or a subtopic or an article.
Well, I've written a piece of code in order to delete the articles and its working fine.
What happens if I directly delete the subtopics though there are some articles exsisting under them??and similary with the topics if there are some sub-topics under their belt.
If this is gonna happen, I think the system will not be a stable one.My articles table look like(Article_id, Subtopic_id, Topic_id, Article_name Article_file, Article_keyword)
How best can I do inorder to make the system stable so that I can be able to delete a topic or a sub-topic or an article.
Thanks in advance