[Solved] Count All Result Where Now Date + 2 Days |
Hello I would like to know if this is possible and what best way to go about it is
I have a column on my data base table calendar called date and it displays year-month-day What I am trying to do is get the total number of rows between now() and + 2 days But so far I am unable to do so PHP Code: public function test() { How could I achieve it? Update: I have found this date code below and work it with my function is it correct? Just not sure if safest way. PHP Code: public function test() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Maybe this:
Code: SELECT * FROM `calendar` WHERE `date` BETWEEN NOW() AND ( CURDATE() + INTERVAL 2 DAY );
(12-17-2015, 09:08 PM)skunkbad Wrote: Maybe this: How would I do it the active record way? with the between etc
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |