I'm fetching the column 'toggle' in a LEFT JOIN as a trigger to determine whether or not to use another column on the output side.
So I have this as an example:
SELECT *,o.toggle,t.toggle from teams t
LEFT JOIN team o
ON (joining clause)
Toggle either equals 1 or IS NULL.
The problem is in the output
I can't echo $row['o.toggle']
and $row['t.toggle']
.
It has to be $row['toggle']
.
The second one overrides the first. How do I differentiate those to use them?
Even assigning them variables doesn't help. It doesn't allow me to use the reference letter o or t.
If it's NULL and NULL, that's fine.
If it's 1 and 1, that's fine too.
If it's 1 and 0, 0 wins.
If it's 0 and 1, 1 wins.
I need to be able to use o.toggle and t.toggle.