Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->db->select("*");
- $this->db->from("anuncios");
- if($maxyear > $minyear){
- $this->db->where("year >= $minyear");
- $this->db->where("year <= $maxyear");
- }else{
- $this->db->where("year >= $minyear");
- }
- if($maxprice > $minprice){
- $this->db->where("price >= $minprice");
- $this->db->where("price <= $maxprice");
- }else{
- $this->db->where("price >= ",$minprice);
- }
- if ($model == 'Uninformed') {
- $this->db->where("stateAuto",$state);
- }else{
- $this->db->where('anuncios.modelo LIKE', '%'.$model.'%');
- $this->db->where("stateAuto",$state);
- $this->db->or_where('anuncios.make LIKE', '%'.$model.'%');
- $this->db->where("stateAuto",$state);
- }
- $this->db->order_by('id', 'DESC');
- return $this->db->get()->result_array();
Advertisement
Add Comment
Please, Sign In to add comment