Jump to content

Recommended Posts

Hi I need to find all staff members who have not downloaded ALL documents for a particular phase.

 

I.e Each staff member is linked to a course and each course has many phases.

 

E.g Course 1 contains Phase A which has documents 1,2,3,4, Phase B has documents 5,6,7,8

 

I need to find all staff members from this course who havent downloaded all documents for a particular phase.

 

I.e All staff from course 1 who havent downloaded documents 1,2,3 AND 4.

 

I have a document_download table which stores when a staff member downloads a document like:

 

document_download table

 

id  staff_id    document_id    date_downloaded

 

staff table

 

staff_id    name  address etc

 

Course table

 

course_id    name etc

 

Phase table

 

phaase_id      course_id etc

 

Document table

 

document_id    name

 

Im not sure whats the best way either in a query or using while loops or something but I really need help on this.

 

Thanks in advance

 

Link to comment
https://forums.phpfreaks.com/topic/56339-complicated-method-help/
Share on other sites

Right so far ive got an array of all staff members for the course.

 

All documents for the phase in an array.

 

And all documents for that phase that have been downloaded in an array.

 

Not sure what to do next though. Check the downloaded array against the 'All documents' array somehow?

 

Thanks

Thanks for the help, I think this is what Im looking for.

 

One question though, when I am getting all documents which have been downloaded how do I prevent the array showing more than one of the same document id?

 

For example, if someone downloads the document 10 times it will show in the array 10 times, I just want it to be included in the array once?

 

Thanks

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.