I am trying to update a date field from a row but it does not seem to be affecting it but it is updating other columns as expected. I must be missing something when setting the date:
$task_id = $_POST['task_id'];
$task_started_status = htmlspecialchars($_POST['task_started_status']);
$task_start_date = date('Y-m-d');
// Attempt update query execution
$sql = "UPDATE task_list
SET task_started_status = $task_started_status, task_start_date = $task_start_date
WHERE task_id='$task_id'";
if(mysqli_query($con, $sql)){
header('location: ../tasks.php');
} else {
echo "ERROR: Could not able to execute $sql. " . mysqli_error($con);
}
The database is using the DATE
data type but no errors occur it still believes its all valid - no errors - just not updating and if I VAR_DUMP
on the $task_start_date
it outputs the date id expect it to be.