I am attempting to update my date_process field using php. The mysql field is a date type field and my code is:
$today = date('Y-m-d');
$data =json_decode($_POST['data'], true);
foreach($data as $value){
// update inventory table
$conn->query("update inventory set cost = {$data[$n]['cost']},
csmt = {$data[$n]['csmt']},
hold = {$data[$n]['hold']},
date_process = $today
where sku = {$data[$n]['sku']}");
All of the other fields are updating properly, just the date_process is returning 000-00-00. I have looked at other posts, and from what I can tell I am formatting this correctly( or at least I think I am). Can anyone point out what I am doing wrong??
try adding quotes around the date: