我对下面的代码有问题。
由于某种原因,它仅显示 10 月、11 月和 12 月的日期。
日期具有相同的格式......见下文:
DATE RESULT
2013-02-01 Does Not Display
2013-03-01 Does Not Display
2013-04-01 Does Not Display
2013-05-01 Does Not Display
2013-06-01 Does Not Display
2013-07-01 Does Not Display
2013-08-01 Does Not Display
2013-09-01 Does Not Display
2013-10-01 Displays OK
2013-11-01 Displays OK
2013-12-01 Displays OK
下面是查询代码:
$events = array();
$query = "SELECT title, DATE_FORMAT(date,'%Y-%m-%d') AS date FROM mytable WHERE user_id = '$session_user_id' AND date LIKE '$year-$month%' AND active = 1";
$result = mysql_query($query,$db_link) or die('cannot get results!');
while($row = mysql_fetch_assoc($result)) {
$events[$row['date']][] = $row;
}
任何人都知道为什么会发生这种情况?