Boxerman Posted August 7, 2013 Share Posted August 7, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/280932-who-did-change-it/ Share on other sites More sharing options...
Muddy_Funster Posted August 9, 2013 Share Posted August 9, 2013 that's not really your table layout : you list a few fields from a single table. do a DESCRIBE on all the tables you are using and post it up. Quote Link to comment https://forums.phpfreaks.com/topic/280932-who-did-change-it/#findComment-1444186 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.