I want to create a HTML Table, but the rows should be generated from the values from a mysql database. The problem is that I want to have a boolean box where the user can mark it, and then press a button to update the table in the database. How do I do such a thing ?
Code so far:
<?php session_start(); require("connectToEvent_log.php"); $connectToEvent = connect2db(); $uid = '2'; // for the filnal version: @$_SESSION['uid']; $view_event = "SELECT * FROM event_log WHERE uid = $uid"; $view_event_query = mysqli_query($connectToEvent, $view_event); $row = mysqli_num_rows($view_event_query); $print = mysqli_fetch_array($view_event_query); ?> <html> <head> <title>Events</title> </head> <body> <form action="viewEvents.php" method="POST"> <table border = '1'> <tr> <?php while($row != 0){ echo "<td>".$print['hours']."</td>"; echo "<td>".$print['date']."</td>"; } ?> </tr> </table> <form/> </form> </body> </html>