Is it more trouble than it is worth when you combine two separate queries together, and then you have to update things?

I was having a productive weekend finishing up my Friend-Request module, when I noticed this scenario...

Originally I had just the top query which finds all Friend-Requests which "I" declined (as the "Requestee"), but then it occurred to me that I could send someone a Friend-Request and then decline the initiated request (as the "Requestor"), so I added the second query.

Creating the UNION query below seemed easy enough for *displaying* the data, but it has turned into a real nightmare with my PHP and Form when it comes to making things updatable?!

PHP Code:
SELECT requestorrequesteeusernamephoto_namephoto_labelphoto_approvedrequestor_approvedrequestee_approved
FROM friend 
AS f
INNER JOIN member 
AS m ON f.requestor m.id
WHERE requestee 
=19
AND requestor_approved =1
AND requestee_approved =2
UNION
SELECT requestor
requesteeusernamephoto_namephoto_labelphoto_approvedrequestor_approvedrequestee_approved
FROM friend 
AS f
INNER JOIN member 
AS m ON f.requestee m.id
WHERE requestor 
=19
AND requestor_approved =2
ORDER BY username 

The problem is that all of my PHP code is just looking for a "RequestorID" to update things, but in cases when I sent a Friend-Request to someone and then decided to retract it, I need to work with the "RequesteeID".

I thought I figured things out by creating aliases and rolling the "RequestorID" and "RequesteeID" into a field called "memberID", and "requestor_approved" and "requestee_approved" into "approved".

The problem is my PHP code doesn't know what to do with a generic "memberID" since it needs to stick it in either a "RequestorID" or "RequesteeID".

Since this is a MySQL forum, I guess I am wondering if I should surrender, and just create Two Pages, one displaying "Friend-Requests from Others that I Declined" and then a second page displaying "Friend-Requests from Me that I Declined"?

Hope that makes sense?!

Thanks,



Debbie