0

我正在尝试选择他们记录中的日期 pubMonth + pubYear 已经过去的作者。我已经尝试了几种 WHERE 语句的组合,但它们都没有消除大于 $today 的记录,这是唯一的问题。

这就是我目前所拥有的:

$today = strtotime(date("Y-m-d"));
mysql_select_db($xxxxxxxxxx, $xxxxxxx);
$query_rsfindAuth = "SELECT Author.FirstName, Authors.level2, Authors.pubMonth, Authors.pubYear 
FROM Authors 
WHERE (UNIX_TIMESTAMP(Author.pubMonth+Author.pubYear) 
    < $today) AND level2 = 'Nature'

但我已经尝试过每一个,因为我有点在黑暗中拍摄。

WHERE ((Authors.pubMonth+Authors.pubYear )  < " . $today . ")   AND level2 = 'Nature'
WHERE (Authors.pubMonth+Authors.pubYear )   < $today        AND level2 = 'Nature'
WHERE " . strtotime(pubMonth.pubYear ) . "      < $today)       AND level2 = 'Nature'
WHERE pubMonth+pubYear)             < $today)       AND level2 = 'Nature'
WHERE (UNIX_TIMESTAMP(pubMonth+pubYear )    < $today)       AND level2 = 'Nature'
WHERE UNIX_TIMESTAMP(pubMonth+pubYear )     < " . $today . ")   AND level2 = 'Nature'

一如既往,感谢您的帮助。

4

1 回答 1

1
WHERE UNIX_TIMESTAMP(CONCAT_WS('-', gradYear, gradMonth, '01')) < '$today'
于 2013-09-13T23:16:03.720 回答