두 개의 열을 모두 가지고있는 경우 $ area 및 $ keyword_whomtoteach에 여러 값을 전달할 때 쉼표 keyword_whomtoteach 및 area_tutor가있는 값을가집니다.이 쿼리를 사용하고 있습니다.조건으로 쉼표로 구분 된 값 얻기
이 시점에서 = 1,5 여기 $toteach=1,5 $area=1,5
$search = "keyword_whomtoteach IN (".$toteach.")";
$where = "area_tutor IN (".$area.")";
$this->db->where($search);
$this->db->or_where($where);
$query=$this->db->get();
return $result = $query->result_array();
은 내가 올바른 결과를 얻고 있지만, 문제는 내가 내가 내가 $ toteach = 1 $ 영역을 통과 할 때처럼 뭔가를 원하는이
id keyword_whomtoteach area_tutor
1 1,2,3,4,5 1,2
2 2,3,5 2,3
3 5,6,7 1,4
4 1,5,6 5,6
경우 같은 뭔가가 필요하다 시간의 나는 id 1과 4 모두 keyword_whometoteach = 1,5
[FIND \ _IN \ _SET() vs IN()]의 가능한 복제본 (http://stackoverflow.com/questions/4155873/find-in-set-vs-in) –
이 예제를 보았지만 @matt raines을 (를) 다시 볼 수 없습니다. – Sumit
데이터를 올바르게 정상화 할 수없는 이유는 무엇입니까? –