我希望$minutes
在查詢中以最短的datecommented
(以分鐘表示)。當我回顯$minutes
時,我得到一個空白結果。我究竟做錯了什麼?從查詢中發現日期
$queryuidcount = "SELECT loginid, datecommented
FROM comment
WHERE (HOUR(NOW()) - HOUR(datecommented)) <= 1
AND loginid = '$uid'
ORDER BY datecommented ASC
LIMIT 1'";
$row2 = mysql_fetch_array($queryuidcount);
$minutes = $row2["datecommented"];