Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. $this->db->select('startdate');
  2. $this->db->from('db_dates');
  3. $sdate = date("Y-m-d", strtotime(str_replace('-', '/', `startdate`)));
  4. $timediff = abs(strtotime($sdate) - time());
  5. $days = floor($timediff/(60*60*24));
  6. $where = "( noofdays = 0 OR ( noofdays >='".$days))";
  7. $this->db->where($where);
  8.  
  9. SELECT startdate
  10. FROM db_dates
  11. WHERE ABS(DATEDIFF(STR_TO_DATE(startdate, '%m-%d-%Y'), CURDATE())) > noofdays
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement