Checkbox Toggle
Posted: Sun Apr 14, 2013 6:10 pm
<?php
$con=mysqli_connect("localhost","root","","User_db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM Assessments");
echo "<table class='sortable' border='0' cellpadding='40'
cellspacing='0'>
<thead>
<tr>
<th>Title</th>
<th>Lecturer</th>
<th>Start</th>
<th>Due</th>
<th>Completed</th>
</tr>
</thead>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Title'] . "</td>";
echo "<td>" . $row['Lecturer'] . "</td>";
echo "<td>" . $row['Start'] . "</td>";
echo "<td id='Due'>" . $row['Due'] . "</td>";
echo "<td>" ."<input type='checkbox' id='mycheckbox' name='Completed' value='Completed' />";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
Hello guys I was wondering if the checkbox would get check when the date on $row['Due'] is reached for example 14/04/2013 is the date on Srow['Due']. The checkbox should automatically get the date and check the checkbox permanently.