rockinaway Posted February 8, 2012 Share Posted February 8, 2012 I have two queries joined together with a UNION. ALL the columns that are returned have the same name except 1 field in each table. In the first table the column is called 'football_id' while in the second column it is 'cricket_id'. The query is running fine, but I just wanted to know how I can differentiate between the results that are returned as to see whether they are from the first table (where football_id is present) or the second table (where cricket_id is present). It isn't as simple as using an isset() is it? Link to comment https://forums.phpfreaks.com/topic/256677-union-problems/ Share on other sites More sharing options...
rockinaway Posted February 8, 2012 Author Share Posted February 8, 2012 Basically this problem: http://stackoverflow.com/questions/2260816/how-to-find-out-my-result-table-in-multiple-table-search Although not sure how this method works :s Link to comment https://forums.phpfreaks.com/topic/256677-union-problems/#findComment-1315850 Share on other sites More sharing options...
rockinaway Posted February 8, 2012 Author Share Posted February 8, 2012 Figured it out, thanks anyway Link to comment https://forums.phpfreaks.com/topic/256677-union-problems/#findComment-1315857 Share on other sites More sharing options...
fenway Posted February 8, 2012 Share Posted February 8, 2012 Figured it out, thanks anyway How about you post the solution for everyone's benefit.... Link to comment https://forums.phpfreaks.com/topic/256677-union-problems/#findComment-1315912 Share on other sites More sharing options...
rockinaway Posted February 9, 2012 Author Share Posted February 9, 2012 Already did that.. the link I posted about Link to comment https://forums.phpfreaks.com/topic/256677-union-problems/#findComment-1315992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.