dc_jt Posted June 18, 2007 Share Posted June 18, 2007 Hi Ive got a staff table which contains all staff details and a course table which contains all course details. I then have a table which links staff to a particular course i.e link_id, staff_id, course_id. Now I was wondering, when I delete a staff member from the staff table, should I also delete all links this staff member has in the link table? I.e If the link table was like this: link_id staff_id course_id 1 35 2 2 35 7 3 35 3 4 35 9 Now when I delete staff_id 35 from the staff table should I also delete all from link table where staff_id = 35? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/56054-general-question/ Share on other sites More sharing options...
ToonMariner Posted June 18, 2007 Share Posted June 18, 2007 YES - keep your data tidy. Quote Link to comment https://forums.phpfreaks.com/topic/56054-general-question/#findComment-276829 Share on other sites More sharing options...
per1os Posted June 18, 2007 Share Posted June 18, 2007 It really depends. I find it useful to just make the staff member id "inactive" That way in case of an accidental deletion you still have them there and do not lose all the data. Than when you pull out links you reference the staff table and only pull out links where the staff is active. It is all about how you want to do it. Quote Link to comment https://forums.phpfreaks.com/topic/56054-general-question/#findComment-276836 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.