Advertisement
sanca

calculate

Dec 29th, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. #Controller:
  2. $dateRange=$this->input->post('dateRange');
  3. $explodedateRange=explode('-',$dateRange);
  4. $waktu=trim($explodedateRange[0]);
  5. $waktu2=trim($explodedateRange[1]);
  6. $stat='Publish';
  7.  
  8. #Model:
  9. public function dataByRangeStat($waktu,$waktu2,$stat){     
  10.         $query=$this->db->query("SELECT * FROM ".$this->table." WHERE stat='".$stat."' AND DATE_FORMAT(art_date, '%m/%d/%Y') between '".$waktu."' AND '".$waktu2."'");
  11.         return $query->result();
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement