Advertisement
brunolc

erroCodeIgniter

Feb 6th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1.             $this->db->select("*");
  2.             $this->db->from("anuncios");
  3.  
  4.             if($maxyear > $minyear){
  5.                 $this->db->where("year >= $minyear");
  6.                 $this->db->where("year <= $maxyear");
  7.             }else{
  8.                 $this->db->where("year >= $minyear");
  9.             }
  10.  
  11.             if($maxprice > $minprice){
  12.                 $this->db->where("price >= $minprice");
  13.                 $this->db->where("price <= $maxprice");
  14.             }else{
  15.                 $this->db->where("price >= ",$minprice);
  16.             }
  17.  
  18.             if ($model == 'Uninformed') {
  19.  
  20.                 $this->db->where("stateAuto",$state);
  21.  
  22.             }else{
  23.  
  24.                 $this->db->where('anuncios.modelo LIKE', '%'.$model.'%');
  25.                 $this->db->where("stateAuto",$state);
  26.                 $this->db->or_where('anuncios.make LIKE', '%'.$model.'%');
  27.                 $this->db->where("stateAuto",$state);
  28.  
  29.             }
  30.  
  31.  
  32.             $this->db->order_by('id', 'DESC');
  33.             return $this->db->get()->result_array();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement