不正确的日期时间值:第 1 行的“日期”列的“”
$results=json_decode($postdata,true);
$date1=substr(str_replace('T',' ',$results["time"]),0,19);
//$date=STR_TO_DATE($date1, '%Y-%m-%d %H:%i:%s');
$meterdata=hexdec(substr(strToHex(base64_decode($results["data"])),0,2));
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO lora_packet (date, meterdata,json_data)
VALUES ('".$date1."','".$meterdata."','".$postdata."')";