Query with multiple likes

前端 未结 2 1923
既然无缘
既然无缘 2021-01-25 17:42

All I see is or_like(). Is it possible to query two different \'likes\' and both are mandatory?

return $this->db
  ->select(\'product_key.cont         


        
相关标签:
2条回答
  • 2021-01-25 18:18

    You can pass an array to $this->db->like()which will produce multiple ANDs:

    $array = array('product_key.client_name' => $filter_name, 'product_key.status' => $filter_status);
    $this->db->like($array); 
    
    0 讨论(0)
  • 2021-01-25 18:28

    I just added a condition to show an alert if either or both are missing so it won't output anything. Thanks for the help guys! :)

    0 讨论(0)
提交回复
热议问题