Difficult Join - Can't seem to figure it out
Posted: Sun Jul 29, 2007 10:13 pm
Hello All,
I have, sitting before me, a rather difficult MySQL Join.
I have some data. In one table I have document's filenames and their titles, and in the next table I have the group_id's that are allowed access to the documents.
However, I have an array which provides a list of all the groups of the user is a member of, and there usually is more than one group in the list.
For the past hour or so, I have been attempting to create a query that will select the document's filename if the user is a member of a group that has access to that particular document.
DB Structure:
docs_access:
`docID`
`groupID`
docs:
`docID`
`docTitle`
`docUploadDate`
`docUploader`
`docFilename`
And the user's group info is contained in (for example, lets say): $user['groups']
I am very sorry to bother you all in this manner, but I simply cannot get my mind around this.
Thank You,
Rick
I have, sitting before me, a rather difficult MySQL Join.
I have some data. In one table I have document's filenames and their titles, and in the next table I have the group_id's that are allowed access to the documents.
However, I have an array which provides a list of all the groups of the user is a member of, and there usually is more than one group in the list.
For the past hour or so, I have been attempting to create a query that will select the document's filename if the user is a member of a group that has access to that particular document.
DB Structure:
docs_access:
`docID`
`groupID`
docs:
`docID`
`docTitle`
`docUploadDate`
`docUploader`
`docFilename`
And the user's group info is contained in (for example, lets say): $user['groups']
I am very sorry to bother you all in this manner, but I simply cannot get my mind around this.
Thank You,
Rick