我正在运行这段代码:
$sql = "SELECT IF(TIMEDIFF(NOW(),last_update) > '02:00:00',1,0) AS morethan FROM products LIMIT 1";
if($stmt = $this->connect->prepare($sql)) {
$stmt->execute();
$stmt->bind_result($result);
$stmt->fetch();
$stmt->close();
} else {
return false;
}
return $result;
我明白0
了,这意味着我正在检查的差异没有找到?