我进行了以下查询,该查询将 db 表 parks 更新为列名:纬度、经度、 parking_time和 let_parked。所以它更新了所有列,但没有使用 NOW()更新parking_time列。你知道为什么吗 ?
if(isset($_POST["update"]) && $_POST["update"]==true)
{
if($userid == "1")
{
$parking_time = "(NOW() - INTERVAL 122 MINUTE)";
$results = $mysqli->query("UPDATE parkings SET latitude = '$mLat', longitude = '$mLng', parking_time = '$parking_time', let_parked = '1' WHERE locId = '$mId' ");
}
elseif($userid == '0')
{
$parking_time = "NOW() - INTERVAL 220 MINUTE";
$results = $mysqli->query("UPDATE parkings SET latitude = '$mLat', longitude = '$mLng', parking_time = '$parking_time' WHERE locId = '$mId' ");
}
if (!$results) {
//header('HTTP/1.1 500 Error: Could not Update Markers! $mId');
echo "coudld not update marker." . mysql_error();
exit();
}
exit("Updated successfully Done! $userid, $mId");
}