Ok. So I have a table called jos_sobi2_fields_data that contains multiple fids and sections. For example the baseDate from fid=36 contains “Names” and the baseData from fid=39 contains “Addresses” I need to write a query that is going to select data from jos_sobi2_fields_data and put the Names in one column and the address in one beside it. So far I’ve tried
Select baseDate
from jos_sobi2_fields_data
WHERE fid=36
and section = 54;
UNION ALL
Select baseData
from jos_sobi2_fields_data
WHERE fid=39
AND section = 54;
But when I query this it just lists the baseData from fid=36 first and then under it, it lists the baseData from fid=39. So how do I get it two separate the two into separate columns beside eachother?
P.S. The section is just regarding information from one specific website, so another website might be section = 52.
You should just use a join… something like this maybe:
Replace
<section>with the section number (or a prepared statement placeholder, even better).