[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 |
---|---|---|---|---|
" . $row['Title'] . " | "; echo "" . $row['Lecturer'] . " | "; echo "" . $row['Start'] . " | "; echo "" . $row['Due'] . " | "; echo "" . $row['Completed'] . "
| ";
echo "
[/php]
[php]
<?php $con=mysqli_connect("localhost","root","","User_db"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $strCompleted = $_POST['Completed']; if ($strCompleted == "Completed") { $strCompleted = "NOW()"; } else { $strCompleted = ""; } $sql="INSERT INTO Assessments (Title, Lecturer, Start, Due, Completed) VALUES ('$_POST[Title]','$_POST[Lecturer]','$_POST[Start]','$_POST[Due]','$strCompleted')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error()); } header( "Location: Assessment_Calendar.php" ) ; mysqli_close($con); ?>[/php]
Hi guys I was wondering if, using JQuery or anything possible, I could could click on the “Completed” button and it would check the date on which it was created and it would enter that detail in the “Completed” column
In my Assessment table in the sql database