After a month of troubleshooting, I am at a loss, and hope some good soul here can help. I have three tables UCC, Acknowledgement, BSD. I need to create a record in the BSD table, have accounts in the UCC table review the BSD record, and acknowlege the record. After they acknowledge it, I want a line item to be created in the Acknowledgement table. I need accounts in the UCC table to view only the BSD's they have acknowledged and the BSD's that have been approved but are waiting for them to acknowledge.
I had a very helpful friend try some code out:
[PHP]$result = mysql_query( "SELECT UCC.UCC_ID, UCC.UCC, Acknowledgement.Ack_ID, Acknowledgement.Attained,
Acknowledgement.Acknowledged, Acknowledgement.Attained_Initials, Acknowledgement.Acknowledged_Initials,
Acknowledgement.Message, Acknowledgement.Timestamp, BSD.BSD_ID, BSD.BSD_Number, BSD.BSD_Subject
FROM BSD
LEFT JOIN Acknowledgement ON Acknowledgement.BSD_ID = BSD.BSD_ID
RIGHT JOIN UCC ON UCC.UCC_ID = Acknowledgement.UCC_ID
WHERE
Approved != 'N'
AND UCC.UCC_ID = $UCC_ID
ORDER BY BSD_Number");[/PHP]
The UCC_ID is passed to the page. Long story short... this code works on her server, but will not work on WAMP5 or the server that I am using at work. I can only get two left joins to work, but it does not sort out duplicate BSD numbers that were acknowledged by other UCC's.
I know this may not make sense, but I'm at a loss, and could use any suggestion.
Cheers,
Rouch