I'm running a query (shown below) where I'm checking for a few parameters, one of which is the $trim of a vehicle and getting the average price of the vehicles. The $trim may contain for example:
I'm trying to get the query to return all the records that simply contain LT in their $trim field.
Doesn't seem to be working. Any idea where I may be going wrong? If I test using simply 'LT' as the $trim value, works as expected. Once there is anything else for a trim value... nada
$this->db->where('mileage <=', ($mileage + 20000));
$this->db->where('mileage >=', ($mileage - 20000));
$this->db->like('trim', $trim, 'both');
$query = $this->db->get();