Jump to content

General question


dc_jt

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/56054-general-question/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/56054-general-question/#findComment-276836
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.