FIND_IN_SET with two strings

前端 未结 3 696
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-27 15:21

I have this EMPLOYEE table of employees list

+-----+---------------+-------------+
| ID  |EMPLOYEE_ID    | SKILLS      |
+-----+---------------+-------------+
|          


        
3条回答
  •  旧巷少年郎
    2021-01-27 16:15

    $skills = 'select the employee skills';
    $skl_arr = explode(',',$skills);
    $skl_length = count($skl_arr); 
    

    /*query */

    $rows->orwhere(DB::raw("find_in_set('$skl_arr[0]','post_job.skills')"));
    
    for ($i=1; $i < $skl_length ; $i++) { 
                    $rows->$join->on(DB::raw("find_in_set('$skl_arr[$i]','post_job.skills')",DB::raw(''),DB::raw('')));
    
    }
    

提交回复
热议问题