I have a field on a read only SQL table called attended can only hold two values either 0 or 1.
This is how I am printing the field at the moment:
echo "<td>" . $row['attended'] . "</td>";
It only returns 0 or 1 – the value in the attended field. How can I have it return no for 0 (i.e not attended) or yes for 1 (i.e. attended).
Many thanks in advance!
You can use the ternary operator (also known as the conditional operator in some languages)
?::This operator is mentioned in the manual page Comparison Operators under the heading “Ternary Operator”.