如何使用更新查询将DateTime减少一年?
FATAL ERROR Uncaught Error: Cannot use object of type Foo as array
答案 0 :(得分:1)
没有报价,没有美元符号:
UPDATE downloads SET ddtime=DATE_SUB(ddtime, INTERVAL 1 YEAR) WHERE ...
答案 1 :(得分:0)
尝试一下:
$result=mysqli_query($con, "UPDATE downloads SET ddtime= DATE_SUB(ddtime, INTERVAL 1 Year) WHERE downfile LIKE '%yark%'");