Is it at all possible to combine two different query results into one feed of results?
I have two types of content in my site, one is based upon a wordpress network and brings in
Link to post,
Title,
Blog Name,
Image (generated from blog post content),
Date.
the other is a set of user added music links and brings in
Link to music,
Name of music,
Name of artist,
Image (path of uploaded image saved to database),
Date.
List of genres tags (a serialised array)
I tried a union, however despite how these columns all generate the same category of content, the actual contents and therefore how they are output is completely different.
What can I do to combine all of these? Is there a way to figure out which table they are currently from from the union query? Then I could use an if statement to decide how to output the contents.
If you use a UNION you would be able to add in a extra field which is the ‘type’ (i.e. 0 = Blog, 1 = Music, etc.)
Then on the front end of the application retrieve data from that field and then use that to decide what type it actually is / which elements to include.