当我在Google自动填充中选择巴基斯坦拉合尔时;它仅应为类似查询自动选择“拉合尔”

问题描述 投票:-1回答:1

在模型中

function get_search_fuel_prices($fuel_city){

        $this->db->select('*');
        $this->db->from('fuel_price');
        $this->db->like('fuel_city',$fuel_city);
        return $this->db->get()->result();

    }
php mysql codeigniter
1个回答
0
投票
//split the location by comma
$arr = explode(",",$fuel_city);

//then
$this->db->like('fuel_city',$arr[0]);
© www.soinside.com 2019 - 2024. All rights reserved.