我有以下查询,其中interest
是字段名称。 interest
包含足球,排球等。
SELECT * FROM `drop_down_multiples` where find_in_set('football',`interest`);
我坚持在CakePHP
转换上述查询。我怎么能转换?
感谢。
答案 0 :(得分:1)
有些事情是这样的: -
cakephp对此没有任何功能,你必须做一些像cakephp建立的技巧 从他们的语法中查询SQL。
$this->DropDownMultiples->find('all',array(
'conditions'=>array('FIND_IN_SET("'.$search_field.'",DropDownMultiple.interest)')
));