I've been looking for hours trying to find a solution. It has to be a simple one, yet, I can't find it. All works well without the if-statement. Each row gets its button. But whenever I put the if-statement back in, the buttons dissappear. What am I doing wrong? Am I overlooking the obvious?
foreach($result as $row) {
echo "<tr>
<td>".date('d F Y', strtotime($row['DATE']))."</td>
<td>".date('H:i ', strtotime($row['TIME']))."</td>
<td>".$row['NAME']."</td>
<td>";
if ($row['availability'] == 0) { echo "FULL"; }
else if ($row['availability'] != 0) { echo $row['availability']; };
"</td>
<td> <form method='post' action='res2.php'>
<input type='submit' name='action' value='Next'>
<input type='hidden' name='ID' value='".$row['ID']."'>
</form> </td>
</tr>";
}
ifbut never restart it, so everything after is just a string, not attached to anything nor output.echoafter theif/elseblock.if/elsestatement.else ifcondition is the opposite of theifcondition, you should just useelse.