A Database Error Occurred

Error Number: 3685

Illegal argument to a regular expression.

SELECT SQL_CALC_FOUND_ROWS I.*, '' as route_from, concat('/inventory/view/', I.id) as page_url, '' as files_list, '' as files_list_url, I.id as I_id, I.name as I_name, coninv.id_to as connected_inventory_id FROM `inventory_manage_cache` `I` LEFT JOIN `connections` `con_res` ON `con_res`.`connection_type_id` = 242349 and `con_res`.`id_from` = `I`.`id` LEFT JOIN `resources_manage` `res` ON `res`.`id` = `con_res`.`id_to` LEFT JOIN `connections` `coninv` ON `coninv`.`id_to` = `I`.`id` and `coninv`.`connection_type_id` = '242242' /*and coninv.extra_field_1 = 1*/ WHERE ( LCASE(CAST(I.ready_to_grow_text AS CHAR)) rlike '' ) GROUP BY `I`.`id` ORDER BY (I.total_stock > "0.0001") Desc, if(I.botanical_name='' or I.botanical_name is null, 'zzz', I.botanical_name) ASC, `I`.`inventory_name` asc LIMIT 50

Filename: /var/www/clients/client2/web6/web/template/models/Maincontroller_model.php

Line Number: 1825