我需要使用正确的日期从数据库中检查日期 + 1 个月。我尝试:
$todayDate = date("Y-m-d");
$dateOneMonthAdded = strtotime(date("Y-m-d", strtotime($todayDate)) . "+1 month");
$result = mysql_query('SELECT UNIX_TIMESTAMP("date") AS date FROM followform WHERE id = "28"') or die(mysql_error());
$date = mysql_fetch_assoc($result);
if ($dateOneMonthAdded == $date['date']) echo 'nice';
但是 $date['date'] == 0
如果我使用 -mysql_query('SELECT date FROM followform WHERE id = "28"')
$date['date'] == 2012-08-13
我的错误在哪里?