jeudi 7 janvier 2021

Form in array doesn't show button after if-statement

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>";
        }

Aucun commentaire:

Enregistrer un commentaire