Hi guys. I was wondering if there was a way if I could check the checkbox and it would somehow detect the date of when it was checked and automatical add it to a certain column and row. here is what iv done so far
Table
[php]
<?php
$con=mysqli_connect("localhost","root","","User_db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO Assessments (Title, Lecturer, Start, Due, Completed)
VALUES
('$_POST[Title]','$_POST[Lecturer]','$_POST[Start]','$_POST[Due]','$_POST[Completed]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error());
}
header( "Location: Assessment_Calendar.php" ) ;
mysqli_close($con);
?>
[/php]
Adding shedules
[php]
| Title Name: |
|
| Module Lecturer: |
|
| Start Date: |
|
| Due Date: |
|
|
|
[/php]
Shedules
[php]
<?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 "
| Title |
Lecturer |
Start |
Due |
Completed |
";
while($row = mysqli_fetch_array($result))
{
echo "";
echo "| " . $row['Title'] . " | ";
echo "" . $row['Lecturer'] . " | ";
echo "" . $row['Start'] . " | ";
echo "" . $row['Due'] . " | ";
echo "" . $row['Completed'] . "
| ";
echo "
";
}
echo "
";
mysqli_close($con);
?>
[/php]
In the form I left out the “completed” column which I added on the table. I want to use the checkbox to insert the date on the “completed” column. is there any way using php/javascript that I could possibly detect the detect the date and add it to the column “Completed”.