mercredi 31 janvier 2018

Inserting checkboxes inside php code

I'm trying to use checkboxes to update information in a MySQL database.

The 'Sent' column is a Boolean.

Is there a way to put a checkbox inside my php code,tbody so, instead of <td>".$infoItems['Sent']."</td> there's a checkbox instead of zeroes.

<table class="scroll">
  <thead>
    <tr>
      <th>Schools Name</th>
      <th>Schools Email</th>
      <th>Sent</th>
    </tr>
  </thead>

  <tbody>
      <?php

      $execItems = $conn->query("SELECT Name,SchoolMail,Sent FROM Schools");

      while($infoItems = $execItems->fetch_array())
      {
        echo    "
                <tr>
                    <td>".$infoItems['Name']."</td>
                    <td>".$infoItems['SchoolMail']."</td>
                    <td>".$infoItems['Sent']."</td>
                </tr>
            ";
        }
    ?>
    </tbody>
</table>
</body>

</html>




Aucun commentaire:

Enregistrer un commentaire