skip to Main Content

Php versions – update datetime with null value in mysql by php

I'm using this code to update my datatime field to NULL, php version 7.3.7 if($_POST['value']=='0000-00-00 00:00:00'){ $timestamp=NULL; }else { $dateTime = $_POST['value']; $timestamp = date('Y-m-d H:i', strtotime($_POST['value'])); } $query="update forms set $_POST[limitInputField]='$timestamp' where formid='$_POST[formId]'"; $result=$dbCnn->query($query)or die($dbCnn->error); it gives error when…

VIEW QUESTION
Back To Top
Search