I'm trying to achieve a red background color for a table cell if the query yields no as an answer and red background otherwise.I'm a beginner in php and dont know how to switch between html and php code.
<?php if($row1['attended']==1){ ?>
< td style="background-color:#99ff99"><?php echo "Yes";}?>
</td>
<?php else{ ?>
<td style="background-color:#ffb3b3"><?php echo "No";}?>
</td>
the error I'm getting :
syntax error, unexpected 'else' (T_ELSE)