Re: Re: SELECT
| From: | tamouse mailing lists | Date: | Thu, 20 Oct 2011 20:33:55 +0000 |
| Subject: | Re: Re: SELECT | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48053@lists.php.net to get a copy of this message | ||
On Mon, Oct 17, 2011 at 12:58 PM, Jim Giner
<jim.giner@albanyhandball.com> wrote:
> I would do it this way:
>
> Where
> $sel_d = (the day # you want)
> $sel_m = (the month # you want)
>
> The "where" clause would be:
>
> Where (start_month => $sel_m and start_day => $sel_d) and
> (end_month =< $sel_m and end_day =< $sel_d)
Hmm, no this won't work. Check this:
start_month=10
start_day=15
end_month=1
end_day=1
sel_day=23
sel_month=12
in this case, sel_month IS greater than start_month and sel_day IS
greater than start_day, HOWEVER sel_month is ALSO greater than
end_month and sel_day is ALSO greater than end_day in this case.
(wrap around to new year problem, wrap around to new month problem)