Jump to content

Who did change it?


Boxerman

Recommended Posts

Hi chaps,

 

I'm a rock in a hard place, basically i want to pull back a row called realname from bugs_activity but only the name of the person who removed CONV from the table..

 

So, the table layout:

 

Field * Type * bug_id mediumint(9) who mediumint(9) bug_when datetime fieldid mediumint(9) added tinytext removed tinytext

 

What i want to get in the WHO REMOVED the work 'CONV' from the BUG_ID.

 

Below you are about to witness the most messed up SQL coding of your life...

SELECT pr.description, bi.BugID, p.login_name AS loginname, p.realname AS prealname, du.realname, b.short_desc, bi.Last_Mod, baw.realname, babid.bug_id
FROM conversions.Box_Info bi
LEFT JOIN conversions.page_refs pr ON (pr.PGID = bi.boxid) 
LEFT JOIN bugs.profiles p ON (bi.UserID = p.userid)
LEFT JOIN bugs.bugs b ON (b.bug_id = bi.BugID) 
LEFT JOIN bugs.profiles du ON du.userid = b.assigned_to
LEFT JOIN bugs.bugs try ON try.assigned_to = du.realname
LEFT JOIN bugs_activity babid ON babid.bug_id = b.bug_id
LEFT JOIN bugs.profiles baw ON baw.userid = babid.who
WHERE bi.box_use in (0,1)
AND babid.removed = 'CONV'
AND (b.op_sys not like 'CONV' AND b.op_sys not like 'CNVA') 
OR b.bug_status = 'CLOSED'  
OR b.bug_status = 'RESOLVED' 
AND bi.matterid != 90
GROUP BY description

What i have managed to get from that is a random name of someone, but not he actual user who is linked with removing 'CONV' from the bugs database.

 

Can anyone point to where i am going wrong!

 

Again sorry for the mess, i hope i provided enough for you gurus.

 

Thanks,

B-Man

Link to comment
https://forums.phpfreaks.com/topic/280932-who-did-change-it/
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.