Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->db->select('startdate');
- $this->db->from('db_dates');
- $sdate = date("Y-m-d", strtotime(str_replace('-', '/', `startdate`)));
- $timediff = abs(strtotime($sdate) - time());
- $days = floor($timediff/(60*60*24));
- $where = "( noofdays = 0 OR ( noofdays >='".$days))";
- $this->db->where($where);
- SELECT startdate
- FROM db_dates
- WHERE ABS(DATEDIFF(STR_TO_DATE(startdate, '%m-%d-%Y'), CURDATE())) > noofdays
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement