【发布时间】:2015-10-02 17:33:59
【问题描述】:
我的日历背面有以下代码:
// I get this from ajax (start month + end of the month)
$post_date_start = $_POST['date_start']; // start month (always), ie: 2015-09-01
$post_date_ending = $_POST['date_ending']; // end month (always), ie: 2015-09-31
// If I get an event which its duration its between $post_date_start and $post_date ending it works properly as you can see:
SELECT * FROM calendar WHERE start_date >= '$post_date_start' AND ending_date <= '$post_date_ending'
问题:它实际上正确地返回了这些范围内的结果。但是如果start_date或ending_date不在这个范围内,它不会返回任何东西。
例如,从 2015 年 7 月 9 日开始到 2015 年 8 月 12 日结束的活动。它应该在 9 月、10 月、11 月和 12 月展示......)。问题是......拥有这两个参数,我该如何在每个月/年显示事件?谢谢!
【问题讨论】:
标签: php mysql calendar fullcalendar