![]() |
[Solved] Count All Result Where Now Date + 2 Days - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: [Solved] Count All Result Where Now Date + 2 Days (/showthread.php?tid=63876) |
[Solved] Count All Result Where Now Date + 2 Days - wolfgang1983 - 12-17-2015 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() { RE: Count All Result Where Now Date + 2 Days - skunkbad - 12-17-2015 Maybe this: Code: SELECT * FROM `calendar` WHERE `date` BETWEEN NOW() AND ( CURDATE() + INTERVAL 2 DAY ); RE: Count All Result Where Now Date + 2 Days - Bhavesh - 12-17-2015 (12-17-2015, 09:08 PM)skunkbad Wrote: Maybe this: Yes, this is perfect. RE: Count All Result Where Now Date + 2 Days - wolfgang1983 - 12-18-2015 (12-17-2015, 09:08 PM)skunkbad Wrote: Maybe this: How would I do it the active record way? with the between etc |